add new record in subgrid

Questionsadd new record in subgrid
Massimo Gagliardi asked 11 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 11 years ago

Hello,

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

Abu Ghufran answered 11 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.

Code: http://pastebin.com/7EpeYN8c

Massimo Gagliardi answered 11 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
Suggestions?

Abu Ghufran answered 11 years ago

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

Massimo Gagliardi answered 11 years ago

Thanks Abu
All is ok

Your Answer

6 + 1 =

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?