I am using Multiselect feature to select rows and pass the data to the controller using getRowData to pass the whole row instead of passing individual cell values. I am having onSelectRow event fired when the user selects a checkbox for a single row. I am able to retrieve the row data using getRowData and pass it to the controller which accepts a string but the data is null. Below is my onSelectRow event.
onSelectRow: function (row_id) {
var rowData = $("#employee").getRowData(row_id);
$.ajax({
type: 'POST',
url: '/Home/Create/',
data: { gridData: rowData },
dataType: "json"
});
This is my controller action that's accepting a string parameter.
public ActionResult Create(string gridData) {}
I have read other posts and tried to use Json.stringify before sending to the controller but I am having difficulty to convert it to the format that I needed, so getting the row data would be more flexible for me to manipulate it.
What should be the paramter that my controller action should accept to retrieve the gridData appropriately?
Any suggestion is greatly appreciated!