Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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...');
}
});
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900