![]() | ||||||||||
![]() | ||||||||||
| ||||||||||
With CodeThatGrid you can
<script language="javascript" src="codethatsdk.js"></script> // SDK <script language="javascript" src="codethattype.js"></script> // types and compare functions <script language="javascript" src="codethatgridpro.js"></script> // CodeThatGrid Class <script language="javascript" src="content.js"></script> // data and global variables (you can use any file name) <link rel="stylesheet" href="style.css"> // style sheet (you can use any file name)
<script language="javascript"> var CodeThatGrid = new CCodeThatGrid("CodeThatGrid", NUM_ROWS, NUM_COLS); CodeThatGrid.init(gridDef); // data initialization from gridDef structure CodeThatGrid.doAction(); // work with table </script> CCodeThatGrid parameters: CodeThatGrid : Object - variable-link to the object from CCod¥ThatGrid class,
its name must ne equal with name passing to constructor
Below is a general structure GridDef (parameters marked (*) are required): var gridDef = { useExportBar : Boolean, // * whether show layer with export form or not useMultiSort : Boolean, // * whether we use multisort useColTitle : Boolean, // * whether we show column titles // * 0 - array (default), 1- csv String, 2 -cvs file, 3 - xml file) datatype : int, data : [][] | CSV String, //* data for columns // * column definitions array (may be empty. // in this case all the columns will be defined as DEFAULT_COLDEF colDef : ARRAY == [ ], // style parameters for table in whole tableStyle : { }, // row style parameters rowStyle : { }, // column stle parameters colStyle :{ }, // cell style parameters cellStyle : { }, // toolbar parameters // if you don't specify this parameter you'll be able to use search feature only // if you'd like to hide some button just remove this button description // from the toolbar description toolBar:{ }, // statusbar parameters statusBar:{ } }; Note: Parameters data : [] and colDef:[] are optional. It means in case you leave its empty, you'll create an empty table. Global variables: var DATE_FORMAT = "dd.mm.yyyy"; // data format var EMPTY_ROW = "no filter"; // default column definition var DEFAULT_COLDEF = { title: "", titleClass: "", type: "String", //the default type width: 0, //auto alignment: "", //auto compareFunction: compare, isVisible: true, useAutoIndex: true, useAutoFilter: false }; Read more about CodeThatGrid >>
|