This is a migrated thread and some comments may be shown as answers.

Why existing combobox control is not load data in different controller?

2 Answers 280 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Suman
Top achievements
Rank 1
Suman asked on 17 Jul 2017, 10:53 AM

Assume I have created Testcontroller and added a Testcombobox control in views(Eg. TestView.cshtml). I implements the function and return data is working fine. Now I added existing Testcombobox control in different Controller (eg. Test1View1.cshtml and Test1Controller) is not loading data and it getting error like uncaught TypeError: Cannot read property 'slice' of undefined.

 

Eg ComboControl.

 @(Html.Kendo().ComboBoxFor(m => m)
        .Name("cbtest")
        .Placeholder("--Select--")
        .DataSource(source => source
                            .Custom()
                            .ServerFiltering(false).Transport(transport => transport

                            .Read(read =>
                            {
                                read.Action("TestAction", "Test");
                            }))
                            .Schema(schema => schema.Data("Data")
                                                .Total("Total")
                                                .Errors("errors")))
        .MinLength(3)
        .AutoBind(true)
        .Filter(FilterType.Contains)
        .DataValueField("sTestEntCode")
        .DataTextField("sTestText")

 

Is there anything missing code or reference?

Note: Using Area Controller and the same control added another area controller.

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 18 Jul 2017, 11:45 AM
Hello Suman,

When using [WidgetName]For method to initialize a widget, the name of the widget is set automatically, therefore I would suggest removing the Name method from the declaration of the widget. 

In the current case, when loading partial views, you also need to make sure that all of the rendered widgets have unique name, otherwise only the widget instance which occurs first in the HTML markup will initialize. 

You can find more information regarding the above issues in the following article:


I hope this helps you to resolve the issue.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Suman
Top achievements
Rank 1
answered on 21 Jul 2017, 05:43 AM
Thanks for the solution and document.
Tags
ComboBox
Asked by
Suman
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Suman
Top achievements
Rank 1
Share this question
or