Say I have a grid and on clicking that button it will send that data to the grid and it will refresh automatically with new data display in the data:
$("#wics").click( function(){
var grid = jQuery("#list10");
var ids = grid.jqGrid('getGridParam','selarrrow');
if (ids.length>0) {
var names = [];
for (var i=0, il=ids.length; i < il; i++) {
var name = grid.jqGrid('getCell', ids[i], 'Name');
names.push(name);
}
//alert ("Names: " + names.join(", ") + "; ids: " + ids.join(", "));
$("#names").html(names.join(", "));
$("#dialog-confirm").dialog({
height:280,
modal:true,
buttons:{
'Cancel': function(){
$(this).dialog('close');
},
'Confirm': function(){
//alert("Confirm");
$.ajax({
type: "POST",
url: "/cpsb/unprocessedOrders.do",
data: { method: "releaseTowics",
orderNum: JSON.stringify(ids),
names: JSON.stringify(names)
},
dataType: "json"
success: function(msg){
alert(msg);
},
error: function(res, status, exeption) {
alert(res);
}
});
}
}
});
}
});
Maybe I will have to pull the new data with the success message in the grid. Basically just need to reload the grid automatically on clicking wics button.
Probably you will find the answer to you question here: How to filter the jqGrid data NOT using the built in search/filter box?
If I correct understand your question you should replace $.ajax
request to setting of url
and postData
parameters (correspond to data parameter of $.ajax
) and page:1 on the second grid with respect of setGridParam
method and call trigger('reloadGrid')
.