add new record in subgrid

Questionsadd new record in subgrid
Massimo Gagliardi asked 6 years ago

When I add a new record in a master grid (records in descending order, the last one is added in the first row) I'd like it to be automatically opened the Add form in the detailed grid or, if not possible, that clicking on the Add icon in the subgrid you can open the Add Form without that says: "Please select the master …"
How can I do?
Thanks in advance
Massimo Gagliardi

5 Answers
Abu Ghufran answered 6 years ago


I will regenerate all the issues that you are facing and will update you.

Abu Ghufran answered 6 years ago

When you add sortorder -> desc in master grid, e.g.

// master grid
$grid = new jqgrid();
$opt["caption"] = "Clients Data";
$opt["height"] = "150";
$opt["sortorder"] = "desc";

The newly added row will come at top and will be selected. You can then click detail grid [+] button to add in details grid.


Massimo Gagliardi answered 6 years ago

Thanks Abu
I had already done as you say but it doesn't work.
I suppose this is because I have a heavy sql with 7 left join (and 1 on a view that sums the totals).
When I insert a new rec in fact appears a "Load" box and the grid loses the focus

Abu Ghufran answered 6 years ago

I've emailed you an update that will wait till completion of load box, and then select new row.

Massimo Gagliardi answered 5 years ago

Thanks Abu
All is ok

Your Answer

13 + 11 =

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

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

Let us improve this post!