Table examples
The sample is as follows:
Our introduction to this article is the Dhtmlxgrid component. It supports 4 kinds of data formats: XML, JSON, CSV, Jsarray.
To add a table to a cell in the layout:
1. Use the Attachgrid () method to add the table to the cell in the layout.
var new Dhtmlxlayoutobject (document.body, "2U"var contactsgrid = Layout.cells ("a"). Attachgrid ();
2. Continue adding code to initialize the Gird settings:
Contactsgrid.setheader ("Name,last name,email"); // sets the headers of columnscontactsgrid.setcolumnids ("Fname,lname,email"); // sets the columns ' IDscontactsgrid.setinitwidths ("250,250,*"); // sets the initial widths of columnscontactsgrid.setcolalign ("Left,left,left"); // sets the alignment of columnscontactsgrid.setcoltypes ("Ro,ro,ro"); // sets the types of columnscontactsgrid.setcolsorting ("Str,str,str"); // sets the sorting types of columns
3. Initialize the table with the Init () method
Contactsgrid.init ();
DHTMLX Front-end framework build one of your application Tutorials (v)--Add a grid of tables