Rank: Newbie Groups: Member
Joined: 5/8/2013 Posts: 5
|
Hi, I have a eo:grid, and i am trying to do something if the item has not been deleted, and another event if it has been deleted.
var k=0; while (k < grid.getItemCount()) { if (grid.getItem(k).isDeleted()==false) { alert("not deleted");
k++; } else { alert("Deleted"); k++; } }
Now in the loop, if the item IS NOT deleted, it alerts "not deleted", but if it is deleted, the page postback. (it should alert "Deleted", right ??) What is the problem ? Thanks.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
grid.getItem(k) returns null if the item is deleted. So you should compare the return value of getItem with null to determine whether an item has been deleted.
isDeleted can be used to determine whether an item is deleted when you previous have a GridItem object, but then it has been deleted from the Grid. In that case you can use isDeleted method on the GridItem that you were holding to determine whether the item has been deleted.
Thanks!
|
Rank: Newbie Groups: Member
Joined: 5/8/2013 Posts: 5
|
It works, Thanks !!
|