Jump to specific row in jsgrid

909 Views Asked by At

I am using JS Grid (http://js-grid.com) to render data in grid view.

My grid has multiple pages. After inserting a row, I want to jump to the page which contains newly added row and highlight the added row.

Does jsgrid provide any option for it. ?

2

There are 2 best solutions below

2
On

You can try this,

var LastRowID = $($("#GridID").find(">tbody>tr.jqgrow:last")).attr('id');

$("#"+LastRowID).effect("highlight", {}, 2000);

0
On

You can do it as follows:

  1. since you are doing server-side pagination (as appears from your comments) compute the page index of the inserted item, knowing the page size and ordering.
  2. Insert server script can return inserted item data. Add a field to the item data (e.g. pageIndex) and set it to the page index computed at (1).
  3. jsGrid has onItemInserted callback, which accepts inserted item data as args.item. In this callback use openPage method to open the page of the inserted item.