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

3 posts, 0 answers
  1. Mathias
    Mathias avatar
    15 posts
    Member since:
    Oct 2014

    Posted 05 May 2015 Link to this post

    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. Mathias
    Mathias avatar
    15 posts
    Member since:
    Oct 2014

    Posted 05 May 2015 in reply to Mathias Link to this post

    oops, forgot the version

    works with 2014.3

    bug is in 2015.1

     

  3. Kendo UI is VS 2017 Ready
  4. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 07 May 2015 Link to this post

    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!
     
Back to Top