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
Post data to the server once and not individually
09/03/2010
16:12
Avatar
gavphillips
New Member
Members
Forum Posts: 1
Member Since:
09/03/2010
sp_UserOfflineSmall Offline

Hi there,

Sorry if this is a stupid question but I've had a look around the examples but can't find one that does what I need it to.

Basically, I am looking to load the data once then allow the users to make changes ( add/delete/amend ) as necessary but only post the data back to the server via a form submit button omce all of the changes have been made.  In other words I don't want to go back to the server each time an edit is made to a row.

Is this possible and if so how do I go about doing it?

Thanks in advance.

09/03/2010
20:43
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Good requirment.

For the form edit it is a little difficult, but not impossible.

Load the data in grid once - loadonce true or what you want.

then set in editurl  a dummy existing file and set reloadAfterSubmit to false.

After the cahnges are done you can get the row data at once

http://www.trirand.com/jqgridw.....ki:methods

See getRowData

and post it to server

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.

15/03/2010
11:31
Avatar
shva
Member
Members
Forum Posts: 6
Member Since:
14/03/2010
sp_UserOfflineSmall Offline

@gavphillips

Maybe it's your mean...

This post data jqgrid once click submit button :

jQuery('#buttonSubmit').click(function(){    

                        jQuery("#htmlTable2 > tbody > tr").each(function (){

                            tmp[this.id] = jQuery("#htmlTable2").getRowData(this.id);

                            $.post("request.php", tmp[this.id],

                                function(data){

                                }

                        });

});

But, That script can't handle delete grid. And It's still post data one-by-one row of grids.

15/03/2010
15:55
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello gavphillips!

Only one remark. Be very carfull if you allow user makes multiple add/edit/remove in once. Depend on situation you will have to protocol exactly the order of changes which user do. Moreover if errors like data inconsistence will be produced in user input, if will be very difficult for both server and user to solve the problems.

For example, if you have some unique indexes in the database and user's input try to brake it. In the case server have to produce an error message with enough information for user to modify his input data. If at the end he will have to input all multiple data one more time, the user will not be happy with your problem. An error after the first wrong input can be more user friendly.

If you plan use "multiple add/edit/remove in once" a good client side data validation could be mandotory.

Or another problem. If user delete some data row and add a new one, everything could be correct from the server side. But if you not protocol the changes, you can interpret user input as data modification, which could produce incorrect data changes.

Of cause everything depends from context. A dangerous is also, that if "multiple add/edit/remove in once" in your first model is correct, but during some changes you'll break this. In a komplex model could be very difficult to find such problems.

So my personal recommendation: do all more simple and you will receive the best results. So think twice about whether you really should invest in "multiple add/edit/remove in once". In the time of quick communication, sending one row to server and back could be the best way.

Regards
Oleg

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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