The scenario is like this ...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);
}
});
}
}
});
}
});
Now may be 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