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
post data is not beig sent when using grid as subgrid
15/01/2010
21:35
Avatar
vpatil
Member
Members
Forum Posts: 7
Member Since:
18/06/2009
sp_UserOfflineSmall Offline

Hi,

I am using grid as a subgrid with datatype as a function

jQuery("#tblProcs").jqGrid({
        postData: { 'TemplID': TemplId },
        datatype: function(pdata) {
            //jQuery("#lui_NodeTable, #load_NodeTable").show();
            jQuery.ajax({ type: "POST",
                url: "../asmx/AddRoom.asmx/GetTemplProcs",
                dataType: "json",
                data: JSON.stringify(pdata),
                contentType: "application/json;charset=utf-8",
                processData: false,
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    //jQuery("#lui_NodeTable, #load_NodeTable").hide();
                    ajaxError("GetTemplProcs", XMLHttpRequest, textStatus, errorThrown);
                },
                success: function(result) {

                    grdData = JSON.parse(result.d);
                    var thegrid = jQuery("#tblProcs")[0];
                    thegrid.addJSONData(grdData);
                    //  jQuery("#lui_NodeTable, #load_NodeTable").hide();
                }
            })
        },

        colNames: ['Name', 'Host Name', 'Location', 'Port', 'Secure Port', 'User Name', 'Password'],
        colModel: [
    { name: 'Name', index: 'Name', width: 100, sortable: false },
    { name: 'IPAddr', index: 'IPAddr', width: 100, sortable: false },
    { name: 'Loc', index: 'Loc', width: 100, sortable: false },
    { name: 'Port', index: 'Port', width: 50, sortable: false },
    { name: 'SecPort', index: 'SecPort', width: 50, sortable: false },
    { name: 'UserName', index: 'UserName', width: 80, sortable: false },
    { name: 'Pwd', index: 'Pwd', width: 80, sortable: false}],
        rowNum: 10,
        rowList: [10, 25, 50],
        pager: '#divProcs',
        viewrecords: false,
        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({
            postdata: { 'ProcID': row_id },
            datatype: function(pdata) {
                    jQuery.ajax({ type: "POST",
                        url: "../asmx/AddRoom.asmx/GetTemplSym",
                        dataType: "json",
                        data: JSON.stringify(pdata),
                        contentType: "application/json;charset=utf-8",
                        processData: false,
                        error: function(XMLHttpRequest, textStatus, errorThrown) {
                            ajaxError("GetTemplProcs", XMLHttpRequest, textStatus, errorThrown);
                        },
                        success: function(result) {
                            grdData = JSON.parse(result.d);
                            var thegrid = jQuery("#" + subgrid_table_id)[0];
                            thegrid.addJSONData(grdData);
                        }
                    })
                },
                colNames: ['Name', 'IPID', 'Version', 'Use SSL'],
                colModel: [
                { name: "Name", index: "Name", width: 80, key: true, sortable: false },
                { name: "IPID", index: "IPID", width: 130, sortable: false },
                { name: "Version", index: "Version", width: 80, align: "right", sortable: false },
                { name: "UseSSL", index: "UseSSL", width: 80, align: "right", sortable: false}],
                rowNum: 10
            })
        }
    });

If I put  a break point in Jquery.js where  it sends data

try {
            xhr.send(s.data);
        } catch(e) {
            jQuery.handleError(s, xhr, null, e);
        }

I see that the postdata is not being serailized.

16/01/2010
11:11
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Try

postData: { 'ProcID': row_id }

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

20/01/2010
14:43
Avatar
vpatil
Member
Members
Forum Posts: 7
Member Since:
18/06/2009
sp_UserOfflineSmall Offline

Thanks!! that worked..

I have another question.. I am trying to add a double click event and a button in toolbar for the subgrid..

In the double click event the row_id does not contain the row id but has the first column value for the row.

 for the click event of the button in the toolbar, I dont get the selarrrow usinmg the getGridParam

var gr = jQuery("#t_" + subgrid_table_id).getGridParam('selarrrow'); here the gr remains undefined

20/01/2010
18:39
Avatar
vpatil
Member
Members
Forum Posts: 7
Member Since:
18/06/2009
sp_UserOfflineSmall Offline

I figured out the doubleclick issue.. it was my mistake I had key:true in the definition for the 1st column..

Still havent found the issue with click event.. I check the innerhtml and outerhtml of jQuery(”#t_” + subgrid_table_id) it shows only the div for the toolbar.. the rest of the tables are not there

22/01/2010
10:48
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

As of your source the id of the grid is

jQuery(”#” + subgrid_table_id).jqGrid({...});

and not

jQuery(”#t_” + subgrid_table_id).getGridParam('selarrrow');

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
56 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