Next Button that moves master record

QuestionsNext Button that moves master record
Glenn asked 9 years ago

Looking for a way to click a button and have the master record move to the next record.
By moving to the next record it would then update all the detail records automatically.


4 Answers
Abu Ghufran answered 9 years ago

You can refer this link, and bind on some button click event.

var grid = $("#grid").jqGrid({…}); with your grid id,
var grid = $("#list1");

Abdullah answered 9 years ago

Abu, could you create example? Thanks.

Glenn answered 9 years ago

Thanks Abu,

Unfortunately I could not get it working.
To test it I also updated your master-detail.php demo with the below code.
The code below is the same as the stackoverflow except the list1 change.

<input type="button" value="Next" id="btnNext">

$('#btnNext').click(function () {

var grid = $("#list1").jqGrid({…});

var selectedRow = grid.getGridParam('selrow');
if (selectedRow == null) return;

var ids = grid.getDataIDs();
var index = grid.getInd(selectedRow);

if (ids.length < 2) return;
if (index > ids.length)
index = 1;
grid.setSelection(ids[index – 1], true);



Glenn answered 9 years ago

My bad.
I took another look right after I sent the email.
Changed the line like you said and it works like a charm.
var grid = $("#list1").jqGrid();

Thank You Abu!

Your Answer

17 + 5 =

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 0 / 5. Vote count: 0

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?