How to get the last record or Last Row of the Grid from jquery

QuestionsHow to get the last record or Last Row of the Grid from jquery
Chandru asked 11 years ago

Hi Abu,

How can we extract the Last Record or Last Row from the GRID?

Any workaround for this.

Regards
Chandru

3 Answers
Abu Ghufran answered 11 years ago

Here is the JS to traverse all grid's data. You can pick last element most likely by data[data.length-1]["gender"]

var grid = $("#list1");
data = grid.jqGrid('getRowData');
for (var x=0;x<data.length;x++)
{
alert(data[x]["gender"]);
}

Hass answered 10 years ago

Is this available only in the paid version?

Abu Ghufran answered 10 years ago

It can be done in free version. Jquery accessing is part of base lib of jqgrid.

You can refer following link for complete JS api.
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs

Your Answer

15 + 7 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 3 / 5. Vote count: 1

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?