Forum
04:06
07/03/2012
Hello Everyone,
PRE: The grid contains several pages
PROBLEM:
1. The user navigates throught the grid and edits values on different pages
2. The user clicks "Save" button expecting to save the changes
RESULT:
Only records on the current view are saved
Here are things that I have done:
var batch = new Array();
var dataIds = $('#results-grid').jqGrid('getDataIDs');
for (var i = 0; i < dataIds.length; i++) {
var data = $('#results-grid').jqGrid('getRowData', dataIds[i]);
batch.push(data);
}
Only the current view records are retrieved. Alternatively, I tried to hash the records by getting the getGridParam('records'). This does not work either because when I try to get the record outside of the scope of the current view, using a loop, the row is undefined (getRowData(i)).
Is there a way to get all the data from the grid?
Is there a way to manually paginate?
04:28
07/03/2012
15:43
Moderators
30/10/2007
Hello,
This method using this way do exactley waht you want.
You should make a diffrence between client side data (this is partial data)
and server side data (this can be the whole data)
Regards
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.
18:14
07/03/2012
Tony,
Thanks for your response. I am doing a loadonce and paginate.
Do you think that I should be posting to the server on some sort of event handler when the user completes navigation to the next view? The data is in memory already because the control loads it from page to page and when a change is made the clientArray gets is and it remembers if the user returns to that page.
Is there a way to acces "clientArray"?
Thanks
03:59
07/03/2012
Hello Tony,
Me again. If I add a function to jqGrid like this then I have access to the entire collection.
getJosesData:
function () {
return this[0].p.data;
},
then in my js file I call it like this:
var
d = $('#results-grid').jqGrid('getJosesData');
I could make it better and do it getting all ids then traverse the data... but this is not desirable. I understand your approach of doing the paging and updates on the server using the editUrl and posting. I tried to negotiate with the BA but the requirement continues to be "save once in a batch when the user clicks Save". This forces me to:
1. do a loadonce
2. cellsubmit: clientArray
The control works great if I only need to display under my requirementes, but I need to save and that is my problem.
How does JQGrid support saving the way I have mentioned?
Best Regards
Jose
Most Users Ever Online: 715
Currently Online:
115 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