Forum


00:07

26/04/2010

Hi ,
I am relatively new user for Jquery/JqGrid .
I am working on a project which needs to move the Data between two grids.
1) Initially the data will load from the server for the both grids.
2) Then user should able to move the data between these two grids (not submit/load the data from the server) client side.
3) There are some other form elements users needs to input before submit the changes to server.
function assignDistGroups(fromGrid, toGrid){
var selArr = $('#' + fromGrid).jqGrid('getGridParam', 'selarrrow');
console.log("Selected rows on Available Dist :" + selArr);
$.each(selArr, function(value){
var selectedRowId = selArr[value];
var rowData = $('#' + fromGrid).jqGrid('getRowData', selectedRowId);
console.log("Value :" + value);
console.log("Selected Row Index Value :" + selectedRowId);
console.log("Row Data Group Name :" + rowData['distGroupName']);
var isAddSuccessful = $('#' + toGrid).jqGrid('addRowData', selectedRowId, rowData, 'after', null);
var isRemoveSuccessful = $('#'+fromGrid).jqGrid('delRowData', selectedRowId);
console.log("Is Successfully Added :" + isAddSuccessful);
console.log("Is Successfully Removed :" + isRemoveSuccessful);
});
$('#'+fromGrid).trigger("reloadGrid");
$('#'+toGrid).trigger("reloadGrid");
return false;
}
$('#'+fromGrid).trigger("reloadGrid");
$('#'+toGrid).trigger("reloadGrid");
The .trigger(“reloadGrid”) call is refreshing from the server. Is there a way I can just refresh client side?
Thank you,
Mohan
13:18

Moderators
30/10/2007

Hello,
The trick is: before triggering the grid's set its datatype to "local".
Also you can switch from datatype to datatype without problems.
For this purpose you can use setGridParam({datatype:'local'});
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.
Most Users Ever Online: 715
Currently Online:
69 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