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 setLayoutURLEx() method to get the Layout information from an URL of the XML file.

var layoutURL = "/koolgrid/LayoutXml/LayoutSimple.xml";
					
function gridReadyHandler(id) {
  document.getElementById(id).setLayoutURLEx(layoutURL);
  document.getElementById(id).setData(gridData);
}

[LayoutSimple.xml]
<?xml version="1.0" encoding="utf-8"?>
<KoolGrid>
  <NumberFormatter id="numfmt" useThousandsSeparator="true"/>
  <DataGrid id="dg1" horizontalScrollPolicy="auto" horizontalGridLines="true" horizontalGridLineColor="0xCCCCCC" 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.