troubleshooting Question

SubGrid ID values for select lists

Avatar of Justin
JustinFlag for United States of America asked on
JavaScript* jqGrid
19 Comments2 Solutions165 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;

Open in new window

where my parent grid is:

Open in new window

but my subgrid uses a Id value that is different:
subGridRowExpanded: function (subgrid_id, row_id) {
            var sg_tableID = subgrid_id + "_t";
            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({

Open in new window

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 our community to see this answer!
Unlock 2 Answers and 19 Comments.
Start Free Trial
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 2 Answers 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