Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
program call in grid as subgrid
03/03/2009
07:58
Avatar
violinssoundcool
Member
Members
Forum Posts: 35
Member Since:
05/02/2009
sp_UserOfflineSmall Offline

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" }
                }
            });
        });

05/03/2009
09:03
Avatar
violinssoundcool
Member
Members
Forum Posts: 35
Member Since:
05/02/2009
sp_UserOfflineSmall Offline

I'm thinking that the problem might be in what external scripts I'm linking to.  When I'm utilizing grid as subgrid, should I include anything other than JQGrid/js/grid.subgrid.js?

05/03/2009
11:40
Avatar
kiaora
New Member
Members
Forum Posts: 1
Member Since:
05/03/2009
sp_UserOfflineSmall Offline

Hi,

I am experiencing this same problem.

Can anyone shine any light onto this please ?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
47 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information