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

Does ComboBox virtualization ONLY work with OData dataSources?

3 Answers 217 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 01 Nov 2017, 04:00 AM
I can't get it to work with a JSON REST services that uses a {"total": 100, "data": [{...}]} format. 

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 01 Nov 2017, 01:24 PM
Hello Ian,

The ComboBox widget can work with JSON REST service. Make sure that the schema.data and schema.total configuration options of the dataSource are being set correctly:
schema: {
  model: {
    fields: {
      ProductID: { type: "string" },
      ProductName: { type: "string" },
    }
  },
  total: "Total",
  data: "Data"
}

In addition to the above, I have prepared a sample ASP.NET MVC solution for your reference, where you can find a working example of a ComboBox Virtualization with JSON (initialized with jQuery). 

Regards,
Dimitar
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.
0
Ian
Top achievements
Rank 1
answered on 01 Nov 2017, 04:03 PM

It wasn't expressly clear that the dataSource must have

    serverFiltering: true

set in its config before the virtual scrolling feature would work. 

Adding serverFiltering: true to my datasource has fixed it.

 

0
Accepted
Dimitar
Telerik team
answered on 02 Nov 2017, 08:23 AM
Hello Ian,

I am glad to hear that you have successfully resolved the issue.

In general, it is recommended that all data operations (paging, sorting, filtering, grouping, and aggregates) are configured to take place either on the server, or on the client. Mixing them might lead to undesired side-effects. In the current scenario where serverPaging is enabled and serverFiltering is disabled, the DataSource will filter only the current data page and you will see less results than expected. This is described in the DataSource's Mixed Data Mode Operations Documentation.

In addition to the above, the minimal widget and DataSource configuration for enabling virtualization is shown in this section of the ComboBox Virtualization Article

Regards,
Dimitar
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
ComboBox
Asked by
Ian
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Ian
Top achievements
Rank 1
Share this question
or