Hi,
I am newbie in using dhtmlxGrid and I am using the dhtmlxGrid for the first time in my application. I have a dhtmlxGrid with 4 colums and I am using the following code to define my column types and attach events:
[code]gGrid.setHeader("#,Cost,Quanity,Total Item Cost");
gGrid.setColTypes(“ch,ro,ed,price”);
gGrid.enableEditEvents(false,true,false);
gGrid.attachEvent(“onEditCell”, doOnEditCell);
function doOnEditCell(Stage,RowID,CellIndex,NewValue,OldValue)
{
if (Stage == 2)
{
if(CellIndex == ‘2’)
{
var NewItemCost = parseFloat(NewValue).toFixed(2) * parseFloat(gGrid.cells(RowID, 1).getValue()).toFixed(2);
NewItemCost = NewItemCost.toFixed(2)
gGrid.cells(RowID,7).setCValue(NewItemCost);
return IsValidQuantity;
}
else
{
alert('A Valid Quantity Should Be Defined.');
return IsValidQuantity;
}
}
}
[/code]
I have the following problems:
- The dhtmlxGrid doesn’t let me check/uncheck my “#” column.
- When I enter a value in “Quanity” and press TAB key then “my “Total Item Cost” displays 0 in that column. (It works only with ENTER key)
- The dhtmlxGrid is also letting me edit my “Total Item Cost” column as well which I want to stop.
Thanks