Dropdown – subgrid

QuestionsDropdown – subgrid
Lars asked 6 years ago

Hello – great grid!

I have a dropdown on a add-form in a subgrid. I need to update the contents in the dropdown after adding a record to the subgrid. I can do this on the -+ button in the mastergrid. I try to refresh subgrid after adding a record – but i doesn't work. I can do a refresh on the mastergrid – it works – but it closes the subgrid.

Any ideas?

BR Lars

2 Answers
Abu Ghufran answered 6 years ago


Q) How to keep subgrid expanded after parent grid's refresh ?

Following JS code snippet will keep subgrid opened after parent's refresh.
You can place this script with parent grid's code.

PHP Part:

// reload previous expanded subgrids on load event
$e["js_on_load_complete"] = "grid_onload";

JS Part:

var scrollPosition = 0
var ids = new Array();

function grid_onload()
jQuery.each(ids, function (id,data) {

// custom refresh button

jQuery('#list1').jqGrid('navButtonAdd', '#list1_pager',
'caption' : 'Refresh',
'buttonicon' : 'ui-icon-extlink',
'onClickButton': function()
ids = new Array();
scrollPosition = jQuery("#list1").closest(".ui-jqgrid-bdiv").scrollTop()
'position': 'last'

eric carichon answered 6 years ago


I need to retrieve the id of the master grid to power a "select" with> get_dropdown_values ​​("SELECT
problem, you must reload the page to get the last id?

how to:

– Retrieve the id (I already used $ id = intval ($ _GET ["rowid"]), but this does not work if I did not reload the page)

– Reload the page each time you click on a grid line 1

Alternatively or if there is a

thank you in advance for your help

eric carichon

Your Answer

16 + 12 =

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!