I have some oData coming back from the lastest ASP.NET web api that looks like this:
{ "odata.metadata":"http://mydomain/odata/$metadata#Users", "odata.count":"3", "value":[ {"FirstName":"Alan","MiddleName":"A.","LastName":"Arlington"}, {"FirstName":"Brad","MiddleName":"B.","LastName":"Boston"}, {"FirstName":"Dirk","MiddleName":"J.","LastName":"Watkins"} ] }
How can I bind this to the igCombo? Notice that the total record count has a dot in the property name. Also, how do I get the igCombo to stop looking for a root of "d"?
I've tried tons of stuff, including the below. Any ideas?
var usersDS = new $.ig.RemoteDataSource({ dataSource: '/odata/Users?', type: 'json', responseDataType: 'json', responseTotalRecCountKey: 'odata.count', responseDataKey: 'value', }); $('#combo').igCombo({ loadOnDemandSettings: { enabled: true, pageSize: 10 }, mode: 'readonlylist', dataSource: usersDS, filteringType: 'remote', width: '250px', textKey: 'LastName', valueKey: 'FirstName', virtualization: true, autoComplete: true, itemTemplate: '${FirstName} ${LastName}', nullText: 'Select an employee' });
I am interested in the solution to this problem too. I am using web api from VS 2012.2 update.
Hello Dirk,
You can refer to the following sample showing (apart from template feature) how to bind combo to oData supplied from remote Data Source - https://www.igniteui.com/combo/templates
Note that when some transformations should be done to the returned data “DataSchema” should be used for this - https://www.igniteui.com/help/api/2019.1/ig.datasource#options:settings
Hope this helps.