I am working on creating a table using the Jqgrid example, I am trying to get the values of all the checked rows and pass the selected values to server using ajax.
Currently it not getting the selected values, when I click get selected button .
here the link to my fiddle
also, is it possible to add radio button to each rows and only one radio button can be selected in the entire table.
/***********************/
$("#getSelected").click(function() {
var ids = $("#output").jqGrid('getGridParam', 'selarrrow');
if (ids.length > 0) {
var names = [];
for (var i = 0, il = ids.length; i < il; i++) {
var name = $("#output").jqGrid('getCell', ids[i], 'Symbol');
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");
//alert ("Names: " + names.join(", ") + "; ids: " + ids.join(", "));
/*$.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);
}
});*/
}
}
});
}
});
/***********************/