How to multi-select rows and send post data to a new datatable? I have an idea with this post but it does not elaborate.I was thinking of multiselecting rows and sending them posting them to a new table on the database, while deleting them from the original table, on click of either a button on the navigation bar or preferably an outside link(like the "finished" at the bottom.
[New edit] This is how my code looks like right now.I've got it posting to a different databsae on click and after i want the selected rows to be deleted from the grid and the database. I've appended the delete function on success but i does nothing to delete. Please any suggestions?
jQuery("#minibutton").click( function(){
var selectedrows = $("#list").jqGrid('getGridParam','selarrrow');
if(selectedrows.length) {
for(var i=0;i<selectedrows.length; i++) {
var selecteddatais = $("#list").jqGrid('getRowData',selectedrows[i]);
var rows=JSON.stringify(selecteddatais)
var postArray = {json:rows};
$.ajax({
type: "POST",
url: "jsonsend.php",
data: postArray,
dataType: "json",
success: function () {
var errors = [];
jQuery("#list").jqGrid('getGridParam','selarrrow').each(function(index, value) {
if (!jQuery("#list").jqGrid('delRowData', value)) errors.push(value);
});
if (errors.length)
{
alert('Already deleted or not in list on row(s): ' + errors.join(', '));
}
}
});
}
}
});
});
</script>