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
sub grid row id on onSelectRow event is always zero
13/02/2010
06:07
Avatar
JQGridFan2
Member
Members
Forum Posts: 4
Member Since:
13/02/2010
sp_UserOfflineSmall Offline

I've just updated to 3.6 (thanks for continuing to support this great java script grid). 

I can't seem to get the edit grid for inline row editing working.  Ideas please.

onSelectRow:

function(subGridRowId)

        jQuery(document).ready(
            function() {
                //uses var lastsel as defined probably in WorkItemMain.ascx
                var currWorkDate = $.datepicker.formatDate('mm/dd/yy', $("#WorkDate").datepicker("getDate"));
                jQuery(gridID).jqGrid({
                    url: gridReadURL + '?WorkDate=' + currWorkDate,
                    datatype: "xml",
                    colNames: ['Id', 'Project', 'Path', 'Task', 'Equipment'],
                    colModel: [
                      { name: 'Id', width: 1, hidden: true, key: true, editable: false },
                      { name: 'Project', width: 120, editable: false, align: 'right' },
                      { name: 'Path', width: 220, editable: false, align: 'right' },
                      { name: 'Task', width: 200, editable: false, align: 'right' },
                      { name: 'Equipment', width: 200, editable: true, edittype: "textarea", align: 'right' },
                    ],
                    rownumbers: true,
                    rowNum: 60,
                    sortname: 'Id',
                    viewrecords: true,
                    height: 500,
                    multiselect: false,
                    subGrid: true,
                    onSelectRow: function(id) {
                        //alert("id : " + id);
                    },
                    caption: "Equipment Work Item",
                   
                    subGridRowExpanded: function(subgrid_id, row_id) {

                        var subGridEquipName = getEquipmentNameForSubGrid(row_id);

                        var subGridProjStructId = getProjStructIdForSubGrid(row_id);
                        var subgrid_table_id = subgrid_id + "_t";
                        jQuery("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table>");
                        jQuery("#" + subgrid_table_id).jqGrid({
                            url: gridReadRatesURL + '?WorkDate=' + currWorkDate + '&EquipmentId=' + subGridEquipId + '&ProjId=' + subGridProjId + '&ProjStructId=' + subGridProjStructId,
                            datatype: "xml",
                            colNames: ['subId', 'ProjectStructureId', 'RateId', 'Rate' ],
                            colModel: [
                              { name: 'subId', width: 1, hidden: true, key: true, editable: false },
                              { name: 'ProjectId', width: 1, hidden: true, editable: false },
                              { name: 'RateId', width: 50, hidden: true, editable: false, align: 'right' },
                              { name: 'Rate', width: 50, editable: false, align: 'right' },
                            ],
                            rownumbers: true,
                            rowNum: 10,
                            sortname: 'subId',
                            sortorder: "asc",
                            caption: "Rates for : " + subGridEquipName,
                            multiselect: false,
                            height: '100%',
                            onSelectRow: function(subGridRowId) {

                                try {
                                    alert("jqGrid id : " + "#" + subgrid_table_id);
                                    alert(" subGridRowId : " + subGridRowId ); //      <-------------   THIS IS ALWAYS = 0   🙁

                                } catch (e) {
                                    alert(e.name + " message " + e.message);
                                }
                            }
                        }); //end of the sub grid definition
                    },
                    subGridRowColapsed: function(subgrid_id, row_id) {
                       
                    },
                    onCellSelect: function(id) {
                        return;
                    },
                    editurl: gridWriteURL,
                    caption: 'Equipment Work Ticket'
                });

            });

onSelectRow:

function(subGridRowId)   <--------- subGridRowId  is always = 0

I've cut and paste the entire grid and subgrid below:

        jQuery(document).ready(
            function() {
                //uses var lastsel as defined probably in WorkItemMain.ascx
                var currWorkDate = $.datepicker.formatDate('mm/dd/yy', $("#WorkDate").datepicker("getDate"));
                jQuery(gridID).jqGrid({
                    url: gridReadURL + '?WorkDate=' + currWorkDate,
                    datatype: "xml",
                    colNames: ['Id', 'Project', 'Path', 'Task', 'Equipment'],
                    colModel: [
                      { name: 'Id', width: 1, hidden: true, key: true, editable: false },
                      { name: 'Project', width: 120, editable: false, align: 'right' },
                      { name: 'Path', width: 220, editable: false, align: 'right' },
                      { name: 'Task', width: 200, editable: false, align: 'right' },
                      { name: 'Equipment', width: 200, editable: true, edittype: "textarea", align: 'right' },
                    ],
                    rownumbers: true,
                    rowNum: 60,
                    sortname: 'Id',
                    viewrecords: true,
                    height: 500,
                    multiselect: false,
                    subGrid: true,
                    onSelectRow: function(id) {
                        //alert("id : " + id);
                    },
                    caption: "Equipment Work Item",
                   
                    subGridRowExpanded: function(subgrid_id, row_id) {

                        var subGridEquipName = getEquipmentNameForSubGrid(row_id);

                        var subGridProjStructId = getProjStructIdForSubGrid(row_id);
                        var subgrid_table_id = subgrid_id + "_t";
                        jQuery("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table>");
                        jQuery("#" + subgrid_table_id).jqGrid({
                            url: gridReadRatesURL + '?WorkDate=' + currWorkDate + '&EquipmentId=' + subGridEquipId + '&ProjId=' + subGridProjId + '&ProjStructId=' + subGridProjStructId,
                            datatype: "xml",
                            colNames: ['subId', 'ProjectStructureId', 'RateId', 'Rate' ],
                            colModel: [
                              { name: 'subId', width: 1, hidden: true, key: true, editable: false },
                              { name: 'ProjectId', width: 1, hidden: true, editable: false },
                              { name: 'RateId', width: 50, hidden: true, editable: false, align: 'right' },
                              { name: 'Rate', width: 50, editable: false, align: 'right' },
                            ],
                            rownumbers: true,
                            rowNum: 10,
                            sortname: 'subId',
                            sortorder: "asc",
                            caption: "Rates for : " + subGridEquipName,
                            multiselect: false,
                            height: '100%',
                            onSelectRow: function(subGridRowId) {

                                try {
                                    alert("jqGrid id : " + "#" + subgrid_table_id);
                                    alert(" subGridRowId : " + subGridRowId ); //      <-------------   THIS IS ALWAYS = 0   🙁

                                } catch (e) {
                                    alert(e.name + " message " + e.message);
                                }
                            }
                        }); //end of the sub grid definition
                    },
                    subGridRowColapsed: function(subgrid_id, row_id) {
                       
                    },
                    onCellSelect: function(id) {
                        return;
                    },
                    editurl: gridWriteURL,
                    caption: 'Equipment Work Ticket'
                });

            }); 

 

13/02/2010
06:09
Avatar
JQGridFan2
Member
Members
Forum Posts: 4
Member Since:
13/02/2010
sp_UserOfflineSmall Offline

hmmmm my cut and paste got a bit messed up.  The grid is pasted twice....here's the full message as it should have been:

I've just updated to 3.6 (thanks for continuing to support this great java script grid). 

I can't seem to get the edit grid for inline row editing working.  Ideas please.

onSelectRow:

function(subGridRowId)   <——— subGridRowId  is always = 0

----------------------------------------------------------------------------------------------------------------------

I've cut and paste the entire grid and subgrid below:

---------------------------------------------------------------------------------------------------------------------

        jQuery(document).ready(
            function() {
                //uses var lastsel as defined probably in WorkItemMain.ascx
                var currWorkDate = $.datepicker.formatDate('mm/dd/yy', $("#WorkDate").datepicker("getDate"));
                jQuery(gridID).jqGrid({
                    url: gridReadURL + '?WorkDate=' + currWorkDate,
                    datatype: "xml",
                    colNames: ['Id', 'Project', 'Path', 'Task', 'Equipment'],
                    colModel: [
                      { name: 'Id', width: 1, hidden: true, key: true, editable: false },
                      { name: 'Project', width: 120, editable: false, align: 'right' },
                      { name: 'Path', width: 220, editable: false, align: 'right' },
                      { name: 'Task', width: 200, editable: false, align: 'right' },
                      { name: 'Equipment', width: 200, editable: true, edittype: "textarea", align: 'right' },
                    ],
                    rownumbers: true,
                    rowNum: 60,
                    sortname: 'Id',
                    viewrecords: true,
                    height: 500,
                    multiselect: false,
                    subGrid: true,
                    onSelectRow: function(id) {
                        //alert("id : " + id);
                    },
                    caption: "Equipment Work Item",
                   
                    subGridRowExpanded: function(subgrid_id, row_id) {

                        var subGridEquipName = getEquipmentNameForSubGrid(row_id);

                        var subGridProjStructId = getProjStructIdForSubGrid(row_id);
                        var subgrid_table_id = subgrid_id + "_t";
                        jQuery("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table>");
                        jQuery("#" + subgrid_table_id).jqGrid({
                            url: gridReadRatesURL + '?WorkDate=' + currWorkDate + '&EquipmentId=' + subGridEquipId + '&ProjId=' + subGridProjId + '&ProjStructId=' + subGridProjStructId,
                            datatype: "xml",
                            colNames: ['subId', 'ProjectStructureId', 'RateId', 'Rate' ],
                            colModel: [
                              { name: 'subId', width: 1, hidden: true, key: true, editable: false },
                              { name: 'ProjectId', width: 1, hidden: true, editable: false },
                              { name: 'RateId', width: 50, hidden: true, editable: false, align: 'right' },
                              { name: 'Rate', width: 50, editable: false, align: 'right' },
                            ],
                            rownumbers: true,
                            rowNum: 10,
                            sortname: 'subId',
                            sortorder: "asc",
                            caption: "Rates for : " + subGridEquipName,
                            multiselect: false,
                            height: '100%',
                            onSelectRow: function(subGridRowId) {

                                try {
                                    alert("jqGrid id : " + "#" + subgrid_table_id);
                                    alert(" subGridRowId : " + subGridRowId ); //      <————-   THIS IS ALWAYS = 0   :-(

                                } catch (e) {
                                    alert(e.name + " message " + e.message);
                                }
                            }
                        }); //end of the sub grid definition
                    },
                    subGridRowColapsed: function(subgrid_id, row_id) {
                       
                    },
                    onCellSelect: function(id) {
                        return;
                    },
                    editurl: gridWriteURL,
                    caption: 'Equipment Work Ticket'
                });

            }); 

14/02/2010
21:13
Avatar
JQGridFan2
Member
Members
Forum Posts: 4
Member Since:
13/02/2010
sp_UserOfflineSmall Offline

I just updated to 3.6.4.  The problem is still there.  The id of the sub grid row is always zero.

I can't see anything obvious that I'm doing wrong.  The sub grid displays properly, you can collapse and expand it.  But when you select a subgridrow and check the id the id of the sub grid row remains zero.

14/02/2010
23:57
Avatar
JQGridFan2
Member
Members
Forum Posts: 4
Member Since:
13/02/2010
sp_UserOfflineSmall Offline

sorry this ended up being my problem.  I had a bug where the row Id in the xml from the server wasn't ever incremented.  So the Id was always =0.

Nothing to fix.  I

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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