Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Use igCombo with custom json data schema
posted

I am using a datasource in my .igCombo() which returns json data comprising of several {"id":"name"} items . They have no header or key information like 0:{"Key":"id","Value":"name"} , so that I don't have any pre demarcated valueKey option.

I am trying to declare a json schema like 

var jsonSchema = new $.ig.DataSchema("json", {fields:[
{name: "zoneId", type: "string"},
{name: "siteName", type: "string"}]
});

But , as soon as I bind this 

var ds = new $.ig.DataSource({ type: "json", dataSource: url, schema: jsonSchema });

It hits my datasource and without any skip or top values and no data is being returned from there.

How to work in such cases , or do I need to modify the json response to always include predefined valueKey options in the response.

Parents
  • 37874
    posted

    Hello Debashish,

    Thank you for posting in our forum.

    I assume by valueKey you mean responseDataKey option of the grid. It is not required in this case. I tested your scenario and it works correctly. You only have to call ds.dataBind() after defining the data source. Then you can get the actual data: ds.data().

    Let me know if this helps.

Reply Children