Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by sachin on Jun 05, 2009 07:58
open dhtmlx forum
SetColTypes() for a gridbased oin a value present in the cell for a particular row .

How do i Set the coltype of a grid dynamically based on the value of a cell present for a row.

If I call the following function after the nodesProcessedGrid.parse(document.getElementById('nodesProcessedGridString').value,"xml");

it is doesnot set the col types .

e.g.  function setColTypes(){

   for (var i=0; i<nodesProcessedGrid.getRowsNum(); i++){
         var ch  = nodesProcessedGrid.cells(nodesProcessedGrid.getRowId(i),3).getValue() ;
 
   if(ch == 'Per Request'){
    alert("isnide ")
    nodesProcessedGrid.setColTypes("ra,ro,ro,ro,ro,ro,ro,ro,ro,link");

   }else{

nodesProcessedGrid.setColTypes("ch,ro,ro,ro,ro,ro,price,ro,ro,link");

}
   }
  }

 

 

 

 

 

Answer posted by Support on Jun 05, 2009 08:13
setColTypes define global column type values, it will have not big effect after rows already rendered. 
Grid has set of methods
    setCellExcellType
    setColumnExcellType
    setRowExcellType
which allows to set cell types dynamically

http://dhtmlx.com/docs/products/dhtmlxGrid/samples/cell_types/pro_col_excell.html