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

Read Data before autocomplete widget opens

1 Answer 144 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Yifan
Top achievements
Rank 1
Yifan asked on 12 Dec 2017, 03:39 PM

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 

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 14 Dec 2017, 01:42 PM
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.
Tags
AutoComplete
Asked by
Yifan
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or