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 to use afterSubmit
14/01/2009
13:31
Avatar
yellow1912
Member
Members
Forum Posts: 5
Member Since:
14/01/2009
sp_UserOfflineSmall Offline

This may sounds dumb, because it really is. I searched many places and couldnt find a clear description for the place where I should call afterSubmit once the field is edited and submit (I want to let users know if the record is saved or not)

My code is below (following the sample showed in doc)

jQuery(document).ready(function(){
  var lastSel;

  jQuery("#list").jqGrid({
    url:'somelink.php',
    datatype: 'json',
    jsonReader : {
      root: "rows",
      page: "page",
      total: "total",
      records: "records",
      repeatitems: true,
      cell: "cell",
      id: "id",
      userdata: "userdata",
      subgrid: {root:"rows",
        repeatitems: true,
        cell:"cell"
      }
    },
    onSelectRow: function(id){
          if(id && id!==lastSel){
        jQuery('#list').restoreRow(lastSel);
        lastSel=id;
          }
          jQuery('#list').editRow(id, true);
    },
    editurl: 'somelink.php?action=edit',

Any suggestion is really aprreciated. I've been pulling out my hairs *_*

19/01/2009
02:39
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

As of the docs the editRow has the following parameters.

editRow (rowid,keys,oneditfunc,succesfunc, url, extraparam, aftersavefunc,errorfunc)

Use succesfunc for this purpose.

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.

20/01/2009
15:36
Avatar
yellow1912
Member
Members
Forum Posts: 5
Member Since:
14/01/2009
sp_UserOfflineSmall Offline

Excellent, thanks Tony

BTW, if I rename the folder js to something else it doesnt work anymore, even when I correctly link jqModal and jqDnR, is there a setting for this or do I have to stick with 'js'?

Thank you

Raine

21/01/2009
10:46
Avatar
yellow1912
Member
Members
Forum Posts: 5
Member Since:
14/01/2009
sp_UserOfflineSmall Offline

Also, after digging into the doc, I found this

succesfunc if defined this function is called immediately after the request is successfully. To this function is passed the data returned from the server. Depending on the data from server this function should return true or false.
I return json in my response, do I have to json decode the returned result in my succesfunc?
Thank you
Raine
22/01/2009
09:55
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Use eval to to parse the string to json data.

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.

22/01/2009
19:14
Avatar
yellow1912
Member
Members
Forum Posts: 5
Member Since:
14/01/2009
sp_UserOfflineSmall Offline

tony said:

Hello,

Use eval to to parse the string to json data.

Regards

Tony


Thanks Tony, that is what I will do now. BTW, can you also have a look at my other question here:

"if I rename the folder js to something else it doesnt work anymore, even when I correctly link jqModal and jqDnR, is there a setting for this or do I have to stick with 'js'?"

Thanks again for all your help

Raine

22/01/2009
20:21
Avatar
yellow1912
Member
Members
Forum Posts: 5
Member Since:
14/01/2009
sp_UserOfflineSmall Offline

To answer my own question:

set path in jquery.jqGrid.js

Raine

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
39 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