Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by James Snyder on Apr 20, 2009 11:14
open dhtmlx forum
setCellExcellType errors

We just purchased the pro version of the grid and I am attempting to use the "setCellExcellType" function. On the thrid line of the following code I get an error: '_celltype' is null or not an object if I use the radio "ra". If I use the checkbox "ch" type I get a standard Missing Image icon (ie: When you naviagate to a web page and the image is missing show with a red X)

grdItemSides.addRow(1, "Side Dish 1,");
grdItemSides.addRow(2, "Side Dish 2,");
grdItemSides.setCellExcellType(1,2,"ra");

So... what am I doing wrong now?

Thanks,
James
Answer posted by dhxSupport on Apr 21, 2009 05:40

MethodsetCellExcellType(rowId, cellIndex, type) has parameters:

# rowId - row ID
# cellIndex - cell index
# type - type of excell (code like "ed", "txt", "ch" etc.)

If you have row with id "1" this method should looks like that:

grdItemSides.setCellExcellType("1",2,"ra");

Answer posted by James Snyder on Apr 21, 2009 07:04

Your answer of "grdItemSides.setCellExcellType("1",2,"ra");" is exactly what I had originally posted.  However that simply displays the red X as in "image missing" (as I said in my original post)  So there is no new information in your answer.   Am I missing a script?  I am including the following scripts:

<script src="scripts/dhtmlxcommon.js" type="text/javascript" ></script>
<script src="scripts/dhtmlxgrid.js" type="text/javascript"></script>
<script src="scripts/dhtmlxgridcell.js" type="text/javascript"></script>
<script src="scripts/dhtmlxcombo.js" type="text/javascript"></script>

Sincerely,
James Snyder

Answer posted by dhxSupport on Apr 21, 2009 07:29

In your original post you wrote: 

grdItemSides.setCellExcellType(1,2,"ra");

First parementer of setCellExcellType should be concluded into the bracket.

If issue still occur please contact support@dhtmlx.com and provide sample where we can reproduce this issue.

Also note that you should call setCellExcellType method only after all rows was loaded:

mygrid.loadXML("grid.xml",function(){

grdItemSides.addRow("1", "Side Dish 1,"); 
grdItemSides.addRow("2", "Side Dish 2,"); 
grdItemSides.setCellExcellType("1",2,"ra");

})