I have been trying to get a grid as a subgrid to work for about a week
now.  When I click the plus sign in a row, I can see (via firebug)
that the code relative to the subgrid gets run, but the server program
doesn't.  It's like it never calls the server-side program.  If
someone could take a look at my code to see what's wrong with it, I
would appreciate it.

        $(document).ready(function()
        {
            var columnNames = ['Warehouse','Quantity','Value'];
            var columnModel = [
                {name:'id', resizable:false, index:'id', width:50,
align:'center', sortable:false},
                {name:'quantity', resizable:false, index:'quantity',
width:90, align:'center', sortable:false},
                {name:'value', resizable:false, index:'value',
align:'center', width:55, sortable:false}];

            var gridwidth = $('.tableContainer').width();
            gridwidth = gridwidth-40;

            $(”#results”).jqGrid(
            {
                url: “RINVINQ2″,
                datatype: “json”,
                mtype: 'GET',
                colNames: columnNames,
                colModel: columnModel,
                //pager: jQuery('#pager2'),
                rowNum: 50,
                rowList: [10,20,50,100],
                imgpath: “../javascript/JQGrid/themes/sand/images”,
                viewrecords: true,
                caption: “Inventory Status By Division”,
                width: gridwidth,
                height: '300px',
                subGrid: true,
                subGridRowExpanded: function(subgrid_id, row_id)
                {
                    var subgrid_table_id;
                    subgrid_table_id = subgrid_id+”_t”;
                      jQuery(”#”+subgrid_id).html(”<table
id='”+subgrid_table_id+”' class='scroll'></table>”);
                    jQuery(”#”+subgrid_table_id).jqGrid(
                    {
                          url:”RINVINQ3?id=”+row_id,
                          datatype: “json”,
                        //mtype: GET,
                          colNames:
['Customer','Quantity','Amount','Last Release Date'],
                          colModel:
                        [
                            {name:"customer",index:"customer",width:
80,key:true},
                            {name:"quantity",index:"quantity",width:
130},
                            {name:"amount",index:"amount",width:
80,align:"right"},
 
{name:"lastReleaseDate",index:"lastReleaseDate",width:
80,align:"right"}
                        ],
                          height: 100,
                        width: gridwidth,
                          rowNum: 20,
                          imgpath: “../javascript/JQGrid/themes/sand/
images”,
                       });
                },

                loadComplete: function()
                {
                    $('#cb').prev().remove();
                    if($(”#results”).getGridParam(”records”)==0)
                    {
                        $('#noResults').dialog(”open”);
                    }
                    else
                    {
                        var page = $('#results').getGridParam(”page”);
                        var records = $('#results').getGridParam
(”records”);
                        var recordsPP = $('#results').getGridParam
(”rowNum”);
                        var x = records/recordsPP;
                        var returnArray = [];
                        if(x < page)
                        {
                            iterLimit = records%recordsPP;
                        }
                        else
                        {
                            iterLimit = recordsPP;
                        }

                        for(var i=1; i<=iterLimit; i++)
                        {
                            $('#'+i).children('td:first').next
().addClass('link').css(”cursor”,”pointer”).css(”color”,”blue”).css
(”text-decoration”,”underline”);

                            var ord = $('#'+i).children
('td:first').next().text();
                            $('#'+i).children('td:first').next().click
(function()
                            {
                                ord = $(this).text();
                                window.location.href = “inv0004?
productGroup=”+ord;
                            });
                            //returnArray = orderList.find(ord);
                            var truefalse = typeof returnArray;
                            if(truefalse != 'boolean')
                            {
                                $('#results').setSelection(i);
                            }
                        }
                    }
                },
                shrinkToFit: true,
                jsonReader :
                {
                    root: “rows”,
                    page: “page”,
                    total: “total”,
                    records: “records”,
                    repeatitems : false,
                    subgrid: { root:”rows”, repeatitems: true,
cell:”cell” }
                }
            });
        });

Reply via email to