Forum


23:20

29/01/2010

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
11:11

10/02/2010

14:32

Moderators
30/10/2007

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.
16:55

29/01/2010

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
22:21

09/02/2010

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 arrayUsing 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:
- Add a dataevent, may type "change" to a column model, set a callback to fire whenever anything changes / goes out of focus.
- The callback will update an array that could be serialized to JSON or multi-dimensional post data later
- Use setCell to update the grid view from the input value and change the style of the row
- User submits changes to server via data set from step 2
- 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
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66