Hi,
I have a screen in which I am using a jtable grid. I select the rows from the grid. Now screen has a button Reassign on click of which I want to navigate/ return another View and pass those selected rows from the grid to the actionmethod which is returning another view.
Below Jquery code is able to call GridDemo actionmthod from Home controller even pass the selected rows, but my problem is that it doesn't return another View and remains on the first View itself, I guess as it's an ajax request.
Could anyone help me how this can be acheived?(sending data to actionmethod but return another view)
Thanks in adavnace!!
My jquery code on clcik of button Reassign is as below:
$("#reassign").click(function () {
var $selectedRows = $('#PersonTable').jtable('selectedRows');
debugger;
$('#SelectedRowList').empty();
var batch = [];
if ($selectedRows.length > 0) { //Show selected rows
$selectedRows.each(function () {
var record = $(this).data('record');
debugger;
batch.push({ BatchType: record.BatchType, LOBType: record.LOBType, Platform: record.Platform, RecieptDate: record.RecieptDate });
});
$.ajax({
type: 'post',
url: '/Home/GridDemo',
data: JSON.stringify(batch),
contentType: "application/json; charset=utf-8",
success: function (data)
{ debugger; ("#Content").html(data) }
});
}
else {
$('#lab1').Visible = true; //No rows selected
$('#lab1').text('No row selected! Select rows to see here...');
}
});