:: Forum >>
Deleting a row
I have a row delete working with left mouse click on the row, with
obj.setAction("click", rowDelete);
But of course this not standard functionality, to delete with a mouse click, and I would like to delete a row when the Delete key is pressed. However, I tried
obj.setAction("onkeyup", rowDelete);
and it doesn't work, I guess this event is not implemented. Does anyone have an idea how I can do this?
Thanks
Rich F
Friday, February 11, 2005
I would love to know this as well asap!
Tuesday, March 1, 2005
function removeRow(grid)
{
var index = grid.getProperty("selection/index");
if (confirm("Do you really want to delete?"))
{
returnVal = myData.splice(index,1);
grid.setRowProperty("count", myData.length);
grid.refresh();
//alert(" count -> "+obj.getRowProperty("count")+ " |=> Deleted Row: " + returnVal);
}
}
//Set Keydown event
obj.setEvent("onkeydown", readChar);
function readChar(e)
{
var key = e.keyCode;
//alert(e);
switch(key)
{
case 46:
answer = confirm("Are you sure to delete?");
if (answer)
{
removeRow(obj);
}
break;
case 13:
answer = confirm("Are you sure to insert?");
if (answer)
{
addRow(obj);
}
break;
}
}
Note: The above code delete a row from the grid which has been loaded
from the Javascript array
Hope it helps u.....
Ritesh Jagga
Wednesday, November 23, 2005
Ritesh
This looks very helpful. Is there a chance of seeing your "addRow" function as well?
(I think the next beta3 version is supposed to have add/delete row capaility, but this is v. useful nonetheless)
Thanks
Will
Will
Wednesday, November 23, 2005
This topic is archived.
Back to support forum
Forum search