Forum


21:55

20/08/2011

hi all,
How do i properly close the editform from within the "afterSubmit" event handler function?
After the user submits the edit form, I leave the edit form open to allow the user to use the prev and next buttons to edit other records. This is normally done by leaving the "closeAfterEdit" property false in the grid nav section.
However, in the "afterSubmit" event handler function, i want to properly close the edit form only if a condition is true.
thanks.
17:14

Moderators
30/10/2007

Hello,
You can triger click to the cancel button.
If I remember right the cancel button has a id = cData
This is not good, since of multigrids with multi forms it will make problems with equal ids.
This should be changed in the future.
In order to overcome this – if the grid has id=GRID, then
$("#cData", "#TblGrid_GRID_2″).click();
Another way is to trgger click to the close buton. See which calss it has to perform this.
Regards
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.
19:22

20/08/2011

Tony,
I wanted to make sure i was closing the form "properly – as in – not messing up other grids and forms".
However, i think you ment to write:
which, according to the jQuery docs, the Descendant Selector (“ancestor descendant”), Selects all elements that are descendants of a given ancestor. Your method is the Multiple Selector (“selector1, selector2, selectorN”), which would trigger the click on all "#cData" ids as well as the "#TblGrid_GRID_2″ id.
In any case, I got it, and the method works and avoids any other issues.
As always, thanks!
Most Users Ever Online: 715
Currently Online:
40 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