Forum


12:54

02/04/2009

I have a subgrid with a grid.
In the parent grid I add three buttons to the end of the parent grid ...
loadComplete: function(){
ids = jQuery("#grid").getDataIDs();
for(var i=0;i<ids.length;i++){
var cl = ids[i];
be = "<input class='smallinput' type='button' value='Edit' onclick=jQuery('#grid').editRow("+cl+"); /> ";
se = "<input class='smallinput' type='button' value='Save' onclick=jQuery('#grid').saveRow("+cl+"); /> ";
ce = "<input class='smallinput' type='button' value='Can' onclick=jQuery('#grid').restoreRow("+cl+"); />";
jQuery("#grid").setRowData(ids[i],{actions:be+se+ce})
}
In the subGridRowExpanded event i set the parent grid columns who have editable: true to false.
If the subGridRowColapsed event i set the parent grid columns who have editable:false to true. The point here is to disable anyone editing a parent grid row until they have completed with the sub grid.
All this works well, the only problem is the editRow, saveRow and restoreRow no longer trigger an inline ediit on the parent rows. Also if I do not expand the subgrid the inline editing works.
Is there a better approach than editable:false on the parent columns, for example: disable the editRow, saveRow and restoreRow buttons!
any ideas?
03:33

Moderators
30/10/2007

Hello,
Which version of jqGrid do you use? Try with the latest stable.
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.
16:21

02/04/2009

Hi Tony,
I was using version is 3.4.2.
It appears in a subgrid inline edit by default users can select and perform an inline edit on any parent. Since you using jquery and provide events within the grid in the right places i was able to utilize jquery to disable parents buttons without much difficulty.
Thank you for viewing my post.
cheers
Most Users Ever Online: 715
Currently Online:
91 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66