Welcome Guest Search | Active Topics | Sign In | Register

grid.isDeleted() method problem Options
X-BOX
Posted: Monday, May 13, 2013 8:15:42 AM
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.
eo_support
Posted: Monday, May 13, 2013 10:10:26 AM
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!
X-BOX
Posted: Monday, May 13, 2013 10:17:12 AM
Rank: Newbie
Groups: Member

Joined: 5/8/2013
Posts: 5
It works, Thanks !!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.