The next action is to set the type of cells in a column or, shortly, the columns' types.
There are a big number of predefined types, each of which has its own code. For example:
This code should be used during setting the type of a column. By default, all cells have the ed type.
We will leave the 1st and 2nd columns editable and assign the price format to the 3rd column.
After the types will be set, we can edit the data in cells by a double click or by pressing F2.
"index.html" file
dhtmlxEvent(window,"load",function(){
mygrid = new dhtmlXGridObject("mygrid_container");
mygrid.setImagePath("codebase/imgs/");
mygrid.setHeader("Name,Quantity,Price");
mygrid.setInitWidths("*,150,150");
mygrid.setColAlign("left,right,right");
mygrid.setSkin("light");
mygrid.setColSorting("str,int,na");
mygrid.setColTypes("ed,ed,price"); //must be called BEFORE initialization mygrid.init(); mygrid.load("data.xml");
});