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_Related Related Topics sp_TopicIcon
Wrong onclicksubmit being fired for jqGrid
Tags: jqgrid
15/07/2011
21:59
Avatar
shah
Member
Members
Forum Posts: 26
Member Since:
30/12/2009
sp_UserOfflineSmall Offline

I am using a treegrid.

It seems like wrong onClickSubmit is being fired.

On loading the grid if i click on edit button and submit the onclicksubmit of the edit fires which is correct. but when i click on Add the correct Add screen appears but onclicksubmit of the edit fires!

If i reload the page and click on Add the onClickSubmit of the Add fires which is correct, next i try to edit Edity form appears and the onclickSubmit of the Add fires.. Please help!!

here is the code

http://pastie.org/private/ycfw.....bxdqgjyohq

Please help!Cry

31/08/2011
17:23
Avatar
solsagan
Member
Members
Forum Posts: 3
Member Since:
20/07/2011
sp_UserOfflineSmall Offline

Had the same problem, haven't looked at the jqGrid code yet, but did find a workaround.

In the code example that you gave, change the onclickSubmit() for both the edit and add options to point to the same function

var afterSubmitFunction = function (rp_ge, postdata) {
  switch (postdata.oper) {
    case "edit":
    break;
    case "add":
    break;
    case "del":
    break;
  }
}

var beforeSubmitFunction = function (rp_ge, postdata) {
  var myGridID = "treegrid";
  switch (true) {
    case typeof postdata[myGridID+"_id"] == "undefined" : // Delete button
      // Do delete stuffs
    break;
    case postdata[myGridID+"_id"] == "_empty" : //Add button
      // Do Add stuffs
    break;
    default : // Edit Button
      // Do edit Stuffs
    break;
  }
}
Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
47 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.com

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information