Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tom H on May 08, 2008 11:07
open dhtmlx forum
changing a column type

I'm using the dhtmlxgrid product professional version.

In one part of my app, I load a grid with three columns - all "ro" type. Later the user clicks a button to switch the display and I need to change the column type of the first column.

I've tried this:

grid.cleanAll(true); // passing false didn't work either
grid.setColTypes("tree,ro,ro");
grid.loadXML("blah.xml");

But the headers are blank and the grid never fills.

Is there a way to make this work?

thanks,
Tom
Answer posted by Support on May 12, 2008 04:00
The problem caused by using "tree" column. While changing of column type is pretty simple operation, which can be done without data reloading, changing type from "ro" to "tree" means that you want to change "grid" to "treegrid" which is more complex process.  In such case you need to redefine all configuration of grid

grid.cleanAll(true);
grid.setColTypes("tree,ro,ro");
    grid.setHeader("A,B,C");
    grid.setInitWidths("100,100,*");
    grid.init();   // recreate grid structure
grid.loadXML("blah.xml");