Next
Update
Prev

KoolGrid uses XML-formatted Layout to represent a Grid, and gets the Layout information from the string value of a variable or an URL of the XML file. This sample Grid demonstrates how to represent a Grid by calling the setLayout() method to get the Layout information from the string value of a variable.

function gridReadyHandler(id) {
  document.getElementById(id).setLayout(layoutStr);
  document.getElementById(id).setData(gridData);
}

var layoutStr = '\ 
<KoolGrid>\
  <NumberFormatter id="numfmt" useThousandsSeparator="true"/>\
    <DataGrid id="dg1" horizontalScrollPolicy="auto" horizontalGridLines="true" horizontalGridLineColor="#CCCCCC" verticalAlign="middle" selectionMode="multipleRows" textAlign="center">\
      <columns>\
        <DataGridColumn dataField="From" width="80"/>\
        <DataGridColumn dataField="Subject" width="120"/>\
        <DataGridColumn dataField="ReceiveDate" headerText="Receive"/>\
        <DataGridColumn dataField="SendDate" headerText="Send"/>\
        <DataGridColumn dataField="CC"/>\
        <DataGridColumn dataField="Level"/>\
        <DataGridColumn dataField="Length" textAlign="right" formatter="{numfmt}"/>\
        <DataGridColumn dataField="AttachCount" textAlign="right" formatter="{numfmt}" width="60"/>\
      </columns>\
    </DataGrid>\
</KoolGrid>\
';

© 2017 KoolChart. All rights reserved.