Forum
15:20
10/08/2009
Hello Tony!
I have a small suggestion. If some jqGrid will support both inline editing mode and form editing, then one have to use restoreRow inside of beforeInitData event handler for example. If one don't do this, the data in the form will be filled with the <input> elements from the inline editing. See http://www.ok-soft-gmbh.com/jq.....tm as an example. Is it not a good idea to call restoreRow with the selected rowId inside of standard jqGrid code of form editing? Not all users know how to fix the problem.
Best regards
Oleg
13:12
13/01/2010
Hi Oleg
I am facing the same issue. I guess this issue still exists in the current jqgrid version? I noticed in your example it works fine. What code updates do I need to make to ensure that a grid with both inlineedit and form editing works?
Also on something related to this, I am using the struts2-jquery plugin which uses jqgrid 3.7.2 at the moment. Currently we dont have the capacity to add our own customized buttons on the grid using the this plugin. My idea is to add a Copy button, then when a row is selected, I will invoke the logic of 'Form Editing' to populate the row selected and then obviously change the unique id in the form to null/empty to mimic a new record. Is this possible to do? If so can you assist with any suggestions?
Thanks.
13:39
10/08/2009
Hi ram2010,
you should just look inside of the source of the demo page which I used. You will see the following code:
var lastSel;
grid.jqGrid({
//...
'#pager',
onSelectRow: function(id) {
if (id && id !== lastSel) {
grid.jqGrid('restoreRow',lastSel);
grid.jqGrid('editRow', id /* ... in case of the client editing*/);
lastSel = id;
}
}
});
grid.jqGrid('navGrid','#pager',
{}, //options
{
height:280,
reloadAfterSubmit:false,
beforeInitData: function() {
// close the inline editing mode
grid.jqGrid('restoreRow',lastSel);
}
} // edit options
);
So you should just call restoreRow(lastSel) every time before start of the the form editing (inside of your custom beforeInitData event handle).
My main suggestion in the feature request was to make modification in the code of the jqGrid. For example if one insert the following code fragment
$t.p.savedRow.length > 0 && $.isFunction($.fn.jqGrid['restoreRow'])) {
for (var i=0;i<$t.p.savedRow.length;i++) {
if ($t.p.savedRow[i].id == rowid) {
$($t).jqGrid('restoreRow',rowid);
break;
}
}
}
before the call of the beforeInitData (see https://github.com/tonytomov/jqGrid/blob/master/js/grid.formedit.js#L796 and https://github.com/tonytomov/jqGrid/blob/master/js/grid.formedit.js#L843) then you will don't need to do anything in your code (see the code used modified jqGrid source).
I hope that Tony makes the corresponding changes in the code of grid.formedit.js.
Best regards
Oleg
12:55
Moderators
30/10/2007
Hello,
Also implemeted. Little changed, but the end goal is achieved.
Kind 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.
Most Users Ever Online: 715
Currently Online:
16 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