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
Edit grid on client then save as a whole
09/02/2010
23:20
Avatar
D_W
Member
Members
Forum Posts: 4
Member Since:
29/01/2010
sp_UserOfflineSmall Offline

I am enjoying your grid quite abit.  I understand how to edit rows and save them one row at a time. However, I would like to allow users to edit grid contects on the client, then save changes to the database all at once.  I would appreciate an suggestions or examples on how to accomplish this.

Thanks,

DW

10/02/2010
05:12
Avatar
xgote
Member
Members
Forum Posts: 13
Member Since:
09/02/2010
sp_UserOfflineSmall Offline

I actually just asked about this before I seen your post.. Sorry for the double post then 🙂

Curious to learn about this as well.

Thanks!

10/02/2010
11:11
Avatar
Seroczynski
The Netherlands
Member
Members
Forum Posts: 17
Member Since:
10/02/2010
sp_UserOfflineSmall Offline

+1, I'm also curious about this possibility. No luck finding any information about it so far.

10/02/2010
14:32
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

As I say again and again - Did you have consult the documentation?

So the answer is in the docs

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

What about using the method

getRowData

Let's  look what the docs say

Returns an array with data of the requested id = rowid. The returned array is of type name:value, where the name is a name from colModel and the value from the associated column in that row. It returns an empty array if the rowid can not be found.
Do not use this method when you editing the row or cell. This will return the cell content and not the actuall value of the input element
If the rowid is not set the method return all the data from the grid in array

Using the last expresion from the docs you will have a aray with all the data.

After that you can convert the array to what you want and post it to the server

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

10/02/2010
16:55
Avatar
D_W
Member
Members
Forum Posts: 4
Member Since:
29/01/2010
sp_UserOfflineSmall Offline

Tony,

Thanks for you rapid reply.  As a new user to JqGrid, I have spent many hours in the documentation, learning the many complexities of the jqGrid to take advatage of is extreme usefulness.  However, I have to apologize but I am still learning the terminology, syntax, and usage of the many features.   I did read the entry on getRowData, and even now, do not understand how to use it as you describe.  I was hoping you or someone in the user community would have an example I could study to better understand its use. 

Thanks again for you time and effort.

DW

10/02/2010
22:21
Avatar
xgote
Member
Members
Forum Posts: 13
Member Since:
09/02/2010
sp_UserOfflineSmall Offline

tony said:

Hello,

As I say again and again – Did you have consult the documentation?

So the answer is in the docs

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

What about using the method

getRowData

Let's  look what the docs say

Returns an array with data of the requested id = rowid. The returned array is of type name:value, where the name is a name from colModel and the value from the associated column in that row. It returns an empty array if the rowid can not be found.
Do not use this method when you editing the row or cell. This will return the cell content and not the actuall value of the input element
If the rowid is not set the method return all the data from the grid in array

Using the last expresion from the docs you will have a aray with all the data.

After that you can convert the array to what you want and post it to the server

Best Regards

Tony


Thanks for pointing this out.  So, the takeaway I have is that "no, there is no preconfigured parameter that accounts for this behavior".  This is helpful so we don't re-invent your code so please don't take offense. 

I was thinking this behavoir most of us in this thread are looking for could be accomplished, conceptually, this way:

  1. Add a dataevent, may type "change" to a column model, set a callback to fire whenever anything changes / goes out of focus.
  2. The callback will update an array that could be serialized to JSON or multi-dimensional post data later
  3. Use setCell to update the grid view from the input value and change the style of the row
  4. User submits changes to server via data set from step 2
  5. Hopefully row styles reset to default upon grid render, or else write a method to reset them after submit and before render

A great example of this behavior is how the MySQL Query Browser works.  When you are editing result-sets from it's grid, the rows background changes so you can edit multiple rows before submitting them for update.  Many other RDBMS tools mimic this behavior and is almost standard as far as how grids work in non-web applications.  I'm not complaining but it would be a nice feature to have in future releases.  If I end up writing this case, I'll send you a literal example.

Thanks for maintaining this project :)

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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