troubleshooting Question

SubGrid ID values for select lists

Avatar of Justin
JustinFlag for United States of America asked on
JavaScript* jqGrid
19 Comments1 Solution165 ViewsLast Modified:
Does anyone know how to capture the correct ID value in a jqgrid subgrid to bind a drop down list? I have no issues placing a drop down list in the parent grid but when adding a select list to the subgrid i think i am not correctly using the id values?

In parent grid i can use the grid name, #jqgrid such as in:

var current = $("#jqGrid").jqGrid('getRowData', $("#jqGrid")[0].p.selrow).Name;
where my parent grid is:
$("#jqGrid").jqGrid({

but my subgrid uses a Id value that is different:
subGridRowExpanded: function (subgrid_id, row_id) {
            var sg_tableID = subgrid_id + "_t";
            alert(subgrid_id);
            var pager_id = "p_" + sg_tableID;
            $("#" + subgrid_id).html("<table id='" + sg_tableID + "' class='scroll'></table><div id='" + pager_id + "' class='scroll'></div>");
            jQuery("#" + sg_tableID).jqGrid({


I did place in an alert to see what the ID values are but i am not clear on how to code that correctly? how do i correctly target the subgrid ID to bind the select list?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 19 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 19 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros