Forum


11:06

05/03/2012

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
<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"):
$return['rows'][$i]['id']=$i;
$return['rows'][$i]['cell']=array('A'.$i,'B'.$i);
}
echo json_encode($return);
Grid with expanded SubGrid:
Grid after click on first row in SUB-Grid:
A workaround could be using the grid's idPrefix - option, but this leads to the non working "addRow" - method, filed in this Bug:
Regards
snoopy
11:30

Moderators
30/10/2007

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.
18:53

20/04/2012

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
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66