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
1470
autoGenerateColumns and json data doesn't generate grid data.
posted

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":, ...

Parents Reply Children
No Data