Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Huzefa on Aug 11, 2009 00:22
open dhtmlx forum
hidding a column using XML

Hi,

I am using the professional version of Dhtmlx components. Also I am using XML to display the grid data and its header. Now i want to hide a particular column of dhtmlxGrid using an attribute in xml. Can you please guide as to which attribute should i use to hide a particular column.

Thanks,
Huzefa
Answer posted by dhxSupport on Aug 11, 2009 01:13
To hide necessary column you can add following line to the grid xml:
<head>
....
<beforeInit>
<call command="setColumnHidden">
  <param>0</param>
  <param>true</param>
  </call>
</beforeInit>
</head>

Also you can use setColumnsVisibility(list) method. Here list - list of true/false separated by comma:
<call command="setColumnHidden">
  <param>false,true,true,true,true</param>
 </call>

Answer posted by huzefa on Aug 11, 2009 01:26

What if i want to pass multiple columns in the params.

Isn't there any way to set the attribute in the column's element like hidden="true" ?

 

Thanks,

Huzefa

Answer posted by Support on Aug 11, 2009 09:58
If you are loading configuration from XML, you can use 
<rows>
    <head>
        <column hidden="true" ...

To have the related column in hidden state after initialization