Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I refresh a Kendo UI combo box?

I have an ASP.Net MVC Kendo UI combobox that is databound to a table with 1000's of records. I've set the MinLength property to 5 so I only return relevant results. The problem is, the user might need to change the text value all together. Is there a way to tell the control to refresh?

Here's the code for the control...

@(Html.Kendo().ComboBoxFor(x => x.Product)
                    .Name("Product")
                    .DataTextField("Name") // Display value
                    .DataValueField("Id") //Return value
                    .MinLength(5)
                    .AutoBind(false)
                    .Suggest(true)
                    .Filter(FilterType.Contains)
                    .DataSource(source =>
                    {
                        source.Read(read =>
                        {
                            read.Action("Products", "Home").Data("onGetProducts");
                        });
                    })
                )
like image 666
Andrew Boes Avatar asked Mar 10 '13 04:03

Andrew Boes


People also ask

What is Kendo UI widgets?

Kendo UI is a bundle of four JavaScript UI libraries built natively for jQuery, Angular, React and Vue. Each is built with consistent API and theming, so no matter what you choose, your UI will be modern, responsive, accessible and fast.


1 Answers

if I understand what you are struggling with: simply call read action again from where ever you need:

$("#Product").data("kendoComboBox").dataSource.read();
like image 96
briler Avatar answered Sep 22 '22 11:09

briler