Forum

July 12th, 2025
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
Where do I add afterSubmit when using form editing (editGridRow)?
14/01/2009
14:30
Avatar
hankhepler
Member
Members
Forum Posts: 6
Member Since:
19/12/2008
sp_UserOfflineSmall Offline

Trying to use a couple of examples in the forum to have some basic error checking. Does anyone have an example of catching server errors when inserting data? Any help, examples, posts will help.

partial code:

$("#adddata").click(function(){ jQuery("#rpsrgrid").editGridRow("new",{height:180,reloadAfterSubmit:true, closeAfterAdd:true})
            afterSubmit : function checksave(result) {....}

Noting happens now, just want to make sure I can debug and/or provide error control.

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

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

Hello,

Maybe this will help:

jQuery(”#rpsrgrid”).editGridRow(”new”,

{height:180,

reloadAfterSubmit:true,

closeAfterAdd:true,

afterSubmit : function() {

// your code goes here

}

});

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.

26/01/2009
14:10
Avatar
hankhepler
Member
Members
Forum Posts: 6
Member Since:
19/12/2008
sp_UserOfflineSmall Offline

Thanks Tony. I figured it out this weekend. I have also been using firePHP in conjunction with Firebug to debug the modal AJAX stuff within the grid, they helped me see what was being posted.

Regards,

H

04/02/2011
09:59
Avatar
mojopower
Member
Members
Forum Posts: 9
Member Since:
04/02/2011
sp_UserOfflineSmall Offline

Just what I need Tony, thanks!!! BTW, in new notation it will be

jQuery("#rpsrgrid").jqGrid('editGridRow', 'new', ….

But what if I would like to call en external function from here?

How to make that?

I've got both edit buttons - in row and in footer.

It's ok when calling external function from footer, but it doesn't work when we using described method

04/02/2011
11:59
Avatar
mojopower
Member
Members
Forum Posts: 9
Member Since:
04/02/2011
sp_UserOfflineSmall Offline

And one more question is why in this case

{reloadAfterSubmit:true, closeAfterAdd:true, afterSubmit : function(response, postdata) { alert(response.responseText); }

afterSubmit function called just once - for the first save. How to force it to call on every save event?

Appreciate any help

04/02/2011
20:04
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Probebly you should use recreateForm:true as additional parameter for both Add and Edit forms.

If you don't use the parameter the Add and Edit dialogs will be shared and created only once. Next the gialog will be not destroyed and recreated every time. Instead of that the dialog will be only hidden/shown. It follows to many side effects. I created the feature request with the suggestion to change the default value from recreateForm:false to recreateForm:true.

If the setting will not help you you should post the full code example which can be used to reproduce the problem.

Best regards
Oleg 

05/02/2011
10:36
Avatar
mojopower
Member
Members
Forum Posts: 9
Member Since:
04/02/2011
sp_UserOfflineSmall Offline

Thanks for your attention Oleg!

It looks like you understand and solved my problem, but I only can check the solution at Monday Laugh

07/02/2011
08:17
Avatar
mojopower
Member
Members
Forum Posts: 9
Member Since:
04/02/2011
sp_UserOfflineSmall Offline

Hmm, actually no change in behavior! For this code:

onclick="jQuery('#list').jqGrid('editGridRow', '" + cl +"', {recreateForm: true, reloadAfterSubmit:true, modal: false, closeAfterAdd:true, closeAfterEdit:true, afterSubmit:function(response) { clientCallBack(response) } });

"clientCallBack(response)" was called only once - when "save" button was pressed for the first time.

How to check form values for all others savings not only first? Or what I'm doing wrong please?

07/02/2011
11:40
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Sorry mojopower, but what you posted is not a code which can be used to reproduce your problem. It should be full JavaScript and full HTML code. At least one row of data which should be edited is also required to reproduce your problem. If you want that somebody help you you should reduce the work of your helper. Moreover many effects exist only together with the usage of some other things. In general afterSubmit are called not once (I have many examples where it work correct). So one need your code having the problem.

One thing I don't understand absolutly from your last post.  Why your code start with "onclick="? I suppose that you try to use the feature in absolutely exotical way.

Best regards
Oleg 

07/02/2011
12:47
Avatar
mojopower
Member
Members
Forum Posts: 9
Member Since:
04/02/2011
sp_UserOfflineSmall Offline

Oleg, please take a look at "Row Editing" -> "Custom Edit" sample at http://www.trirand.com/blog/jq.....qgrid.html

Here is the exotical code, starting with "onclick=" and sample, where the afterSubmit is called once only – first time you click submit with any options.

Please, try – i used this sample to reproduce the behavior.

-- my code --

onclick="jQuery('#list').jqGrid('editGridRow', '" + cl + "', {recreateForm: true, reloadAfterSubmit:true, modal: false, closeAfterAdd:true, closeAfterEdit:true, afterSubmit:function(response) { clientCallBack(response) } });"
...
<script language="javascript" type="text/javascript">
function clientCallBack(serverArgs) {
alert('Just once!');
}
</script>

07/02/2011
13:28
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello mojopower,

I have no source code of the demo side. I have no time to create a demo code which reproduce your problem. So if you want that I help you, you should post the full code which can be used to reproduce the descrided problem.

Oleg

07/02/2011
14:13
Avatar
mojopower
Member
Members
Forum Posts: 9
Member Since:
04/02/2011
sp_UserOfflineSmall Offline

Man, it is wierd code from official demo, it's not mine! Can't believe it is difficult for YOU to understand and reproduce it!

Please clarify - do you need all of my solution files or what part of it?

07/02/2011
14:41
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

I am a user like you (see my status as "Member" like youth and "Moderator" like th status of the developer of jqGrid Tony)!

You want to use a free open source software and you want that someone who also use tha same software help you. If you wait for sombody in the world help to solve your problem for free you should be polite and prepare your problem so that other, who decide help you, could at least easy reproduce your problem. See for example questions from other people or look at my answers where I post frequently a link for a working solution.

Oleg

07/02/2011
15:48
Avatar
mojopower
Member
Members
Forum Posts: 9
Member Since:
04/02/2011
sp_UserOfflineSmall Offline

Man! You want to help people, don't you? You answered my question, didn't you? Thanks for your help actually!

I thought it is easy to implement callback function in official demo sample, it is just couple rows of code!

You asking me to prepare a small project just because you can't spent half a minute to try to understand what I meant?

Yes, I know mate that you are user like me, and even Tony is developer - so what?

What is the difference between GNU or MTI project developer and forum user, hm?

Let's be polite to each other and be respectfully to the whole project, not just to you, ok?

br bro

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

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