This code renders a grid:
$("#igGrid").igGrid({ autoGenerateColumns: false, columns: [ { headerText: "Barcode", key: "Barcode", dataType: "string" }, { headerText: "Court Description", key: "CourtDescription", dataType: "string" }, { headerText: "Case Type Description", key: "CaseTypeDescription", dataType: "string" }, { headerText: "Date Filed", key: "DateFiled", dataType: "date" }, ], fixedHeaders : true, width : '100%', height : '250px', responseDataKey : 'Rows', dataSourceType : 'json', dataSource : result.d.JSONData });If I turn on autoGenerateColumns and remove the column property then I get a grey block with no data.Here is what result.d.JSONData looks like:{"Rows":[{"Barcode":"00a00-0000-aa-000001","CourtDescription":"(None)","CaseTypeDescription":"(None)","DateFiled":"\/Date(1314939600000-0500)\/","Tracking_ID":"7ca96f89-32d5-4203-9bc6-772157175d91","DateClosed":null,"DateReinstated":null,"DateDismissed":null,"StatusDescription":"(None)","Names1TypeCode":"AD","Names1":"Pete","Names2TypeCode":"WD","Names2":"Mike","Comments":"Other Comment"},{"Barcode":"11A11-1111-AA-111111","CourtDescription":"C01","CaseTypeDescription":"AD","DateFiled":"\/Date(1313816400000-0500)\/","Tracking_ID":"598d02db-88a4-40e8-beda-4c1d517433fc","DateClosed":null,"DateReinstated":null,"DateDismissed":null,"StatusDescription":"Open","Names1TypeCode":"DC","Names1":"Test","Names2TypeCode":"TR","Names2":"test 2\ntest 3","Comments":null},{"Barcode":"11A11-1111-AA-111112","CourtDescription":"D02","CaseTypeDescription":"TR","DateFiled":"\/Date(1314939600000-0500)\/","Tracking_ID":"7f70fb59-80ad-4973-8b99-b6f5ca00482e","DateClosed":null,"DateReinstated":null,"DateDismissed":null,"StatusDescription":"Open","Names1TypeCode":"WD","Names1":"W: 1\nD: 2","Names2TypeCode":"DC","Names2":"D: A\nC: B","Comments":"More stuff to type."}]} I have this on my page: <b>Start</b><br /> <table id="igGrid"></table><br /> <b>End</b><br />
If I understand autoGenerateColumns it should take the JSON data and pull out the column names and use them: "Barcode", "CourtDescription":, ...
hey Pete,
Could you let me know which build you are using ? I just tried this sample with the latest available code i have and couldn't find an issue. Thank you,
Angel
Hi Angel,
I am using ig.ui.min that is version 11.1.20111.2030
Thanks Pete. I will coordinate with our Development Support team to have it investigated.
Hello Pete,
A development issue has been logged about this behavior with number #91431 – “When autoGenerateColumns = true the value of the responseDataKey option is disregarded and the grid is not bound to the correct data”. As soon as the issue is resolved you will be notified in order to take advantage of the resolution. As a workaround we suggest :
1. Alter the “products” variable and expose the array of objects directly (instead of hiding it in the “Rows” property of a parent object)
2. Alter the configuration of the igGrid so that it bind to the inner array of objects like so:
dataSource: products.Rows
Hope this helps a bit.
If it's any extra help I have attached a sample project where I have reproduced the issue. It could be a javascript reference issue or something else.
Thanks,
Pete