Next
Update
Prev
View Data

This sample Grid demonstrates how to represent a Grid by calling the setDataURLEx() method to get the Dataset information from an URL of the JSON file, and the data used in this sample Grid can be imported by using the getCollection() method. Click the button below the sample Grid, then the JSON-formatted data will pop up.

var gridApp, gridRoot, dataGrid, collection;

function gridReadyHandler(id) {
  gridApp = document.getElementById(id);
  gridRoot = gridApp.getRoot();

  gridApp.setLayout(layoutStr);
  gridApp.setDataURLEx(gridDataURL);
}

function getCollectionJSONData() {
  if (collection == null)
    collection = gridRoot.getCollection();
    
  if (collection == null) {
    alert("Cannot find the collection object.");
    return;
  }
		
  var data = collection.getSource();
  alert("Data Size: "+data.length+"\n1st Data: "+data[0].From+","+data[0].Subject+","+data[0].ReceiveDate+","+data[0].CC+","+data[0].AttachCount);
}

© 2017 KoolChart. All rights reserved.