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

BUG - Datasource will not be read when refesh is called before

2 Answers 14 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mathias
Top achievements
Rank 1
Mathias asked on 05 May 2015, 10:59 AM

hi there, 

When we used your example

http://demos.telerik.com/kendo-ui/combobox/serverfiltering

and added a single line (the one with refresh)

$(document).ready(function() {
    $("#products").kendoComboBox({
        placeholder: "Select product",
        dataTextField: "ProductName",
        dataValueField: "ProductID",
        filter: "contains",
        autoBind: false,
        minLength: 3,
        dataSource: {
            type: "odata",
            serverFiltering: true,
            transport: {
                read: {
                    url: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Products",
                }
            }
        }
    });
  $("#products").data("kendoComboBox").refresh();
});

we had an strange behaviour

if you type in the text field - everything is normal

if you press on the arrow, no items will be shown, over network we saw, that the datasource has not been read.

 

best regards

mathias

 

 

2 Answers, 1 is accepted

Sort by
0
Mathias
Top achievements
Rank 1
answered on 05 May 2015, 11:00 AM

oops, forgot the version

works with 2014.3

bug is in 2015.1

 

0
Georgi Krustev
Telerik team
answered on 07 May 2015, 07:55 AM
Hello Mathias,

Indeed, the widget will not show any items, because the underlying list will use the current state of the source (it is empty because of the autoBind:false). On open, it will not request the data, as the widget is bound, because of the explicit call of the refresh method. This behavior is different from Q3 2014, but I believe that calling refresh method after widget's initialization is not needed. I believe that you need to call dataSource.read method if you would like to populate the widget.

Could you elaborate a bit why would you need to call refresh method instead of datasource's read or fetch?

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
ComboBox
Asked by
Mathias
Top achievements
Rank 1
Answers by
Mathias
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or