Read Data before autocomplete widget opens

2 posts, 0 answers
  1. Yifan
    Yifan avatar
    8 posts
    Member since:
    Oct 2017

    Posted 12 Dec 2017 Link to this post

    Hi, 

     

    I'm wondering how can I read get the data from datasource before user click on the autocomplete widget. I have the following code:

     

     var ds = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: "../IndividualData/SalesPerson",
                        dataType: "json",
                        data: this.requestData()

                    }
                },
                schema: { data: "data", total: "total" },
                pageSize: 50
            })
            this.autocomplete.setDataSource(ds);
            console.log(this.autocomplete.dataSource);

     

    But it seems like I'm always getting empty datasource for  some reason. Can anyone help me?

     

    Regards,

     

    Yifan 

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    1582 posts

    Posted 14 Dec 2017 Link to this post

    Hi Yifan,

    Here's a dojo example, which shows how the data can be read before any user interaction with the widget, by calling the dataSource's read() method.

    Regards,
    Ivan Danchev
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top