splitAt(1) not working

Hi,



We’re evaluating the TreeGrid control and cannot get the splitAt component to work.



Any ideas?



function doSetupGridHeaders(grid, headers, oncelledithandler) {



grid.clearAll();

// Prepare header and column details

var headerLine1 = “Tree,WorkItemId”;

var colWidths = “120,80”;

var colAlignments = “left,left”;

var colTypes = “tree,ro”;



for (var i = 0; i < headers.length; i++) {

headerLine1 += “,” + headers[i];

colWidths += “,120”;

colAlignments += “,center”;

colTypes += “,co”;

}



//Create headers & set column details

grid.setHeader(headerLine1);

grid.setInitWidths(colWidths);

grid.setColAlign(colAlignments);

grid.setColTypes(colTypes);

grid.setColumnHidden(1, true);

grid.attachEvent(“onEditCell”, oncelledithandler);

grid.setSkin(“light”);

grid.splitAt(1);

grid.init();

}





Thanks, Paul.

  • be sure that dhtmlxgrid_splt.js included in html page
    - splitAt must be executed only after grid initialization
    grid.init();
    grid.splitAt(1);


I’ve added the missing script reference and rejigged my code, and now get:



‘this.obj.firstChild’ is null or not an object



Any ideas?



Thanks, Paul.

The code snippet, posted above, works correctly in local samples ( sample sent by email )

Please check that container DIV of grid has not any inner content on moment of grid initialization, also, beware that splitAt command can be aplied to the grid only once, you can’t apply it to the same grid, second time.



Hi,



I still can’t get it to run. Could you take a look at this page and tell me why the splitAt fails?



 



<%@ Page Language=“C#” %>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "w3.org/1999/xhtml">

   
   
   
   
   
   



   
   



   



   


   
   


          
 
   

   






 

mygrid.setInitWidths("*,150,150");
You can’t use * in left part of splitted grid, it must be some fixed value.

Except of that - sample is fully correct, and works without problems ( sent by email )
If problem still occurs for you - please try to use dhtmlxgrid_splt.js from the sample instead of original one.