Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Yudhi Seymour on Oct 28, 2008 00:02
open dhtmlx forum
Minimal column widths — like HTML table

Hi,

When we create a table using plain HTML each row and column defaults to the minimum size required to show its contents.

Is there a way to get this to occur with the DHTML Grid?

Currently if I do not set a width for each column it defaults to the width of the visible area of the entire grid. It would be nice if the columns could automatically shrink to the minimum possible size.

Cheers,
Answer posted by Support on Oct 28, 2008 02:44
>>Is there a way to get this to occur with the DHTML Grid?

Something similar can be done as

var grid = new ...
grid.setInitWidths("100,100,100"); //set sum init width
....
grid.loadXML(url,function(){
   //after data loading
   for (var i=0; i<3; i++)
        grid.adjustColumnSize(i);
});