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
editRow method in SubGrid
21/04/2012
11:06
Avatar
snoopy
Member
Members
Forum Posts: 15
Member Since:
05/03/2012
sp_UserOfflineSmall Offline

Hi everybody,

I found another Bug (or is it a feature?! 😉 ):

Having a SubGrid in a Grid both with identical id's in rows, using "editRow" methoed ends up with edit mode of both rows in Grid AND SubGrid which have the same ID.

Here a little test:

HTML

    <table id="tblGridA"></table>
    <button type="button" id="btnAddA">+</button>

JavaScript:

        $('#tblGridA').jqGrid({
            datatype:'json',
            url:'test1.php',
            subGrid:true,
            width:500,
            height:300,
            ondblClickRow:function(rowid) {
                $('#tblGridA').jqGrid('editRow',rowid,{keys:true});
            },
            subGridRowExpanded:function(sg_id,row_id) {
                sg_table_id='tblSubGrid_'+sg_id;

                 $('#'+sg_id).html('<table id="'+sg_table_id+'"></table>');

                $('#'+sg_table_id).jqGrid({
                    datatype:'json',
                    url:'test1.php',
                    ondblClickRow:function(rowid) {
                        $('#'+sg_table_id).jqGrid('editRow',rowid,{keys:true});
                    },
                    colNames:['Col1','Col2'],
                    colModel:[
                              {
                                  name:'col1',
                                  editable:true
                              },
                              {
                                  name:'col2',
                                  editable:true
                              }
                            ]
                });
            },
            colNames:['Col1','Col2'],
            colModel:[
                      {
                          name:'col1',
                          editable:true
                      },
                      {
                          name:'col2',
                          editable:true
                      }
                    ]
        });

Server side PHP ("test1.php"):

for($i=0;$i<10;$i++) {
    $return['rows'][$i]['id']=$i;
    $return['rows'][$i]['cell']=array('A'.$i,'B'.$i);
}
echo json_encode($return);

Grid with expanded SubGrid:

[Image Can Not Be Found]

Grid after click on first row in SUB-Grid:

[Image Can Not Be Found]

A workaround could be using the grid's idPrefix - option, but this leads to the non working "addRow" - method, filed in this Bug:

addRow - Bug

Regards

snoopy

21/04/2012
11:30
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

25/05/2012
18:53
Avatar
joshbodine
Member
Members
Forum Posts: 7
Member Since:
20/04/2012
sp_UserOfflineSmall Offline

Tony,

I can't get the link you posted to work; can you please post the full link. I am having the same issue as the OP and was hoping for a resolution. When I have a grid as a subgrid, and in the subgrid I use "ondblClickRow" or "onRightClickRow", it kicks off that event for both the subgrid and the parent grid row.

Thanks

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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