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
How do i close edit form from within afterSubmit event handler function?
10/10/2012
21:55
Avatar
nelsonm
Michigan, USA
Member
Members
Forum Posts: 106
Member Since:
20/08/2011
sp_UserOfflineSmall Offline

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.

11/10/2012
17:14
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

11/10/2012
19:22
Avatar
nelsonm
Michigan, USA
Member
Members
Forum Posts: 106
Member Since:
20/08/2011
sp_UserOfflineSmall Offline

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:

$("#TblGrid_GRID_2 #cData″).click();

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!

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information