0
私はMVCとJquery Dataテーブルを使用しています。 jquery datatable paramと一緒にクラスとして自分のパラメータを渡したいだけです。ここ は、私が使用しているコードですが、それは、jqueryカスタムオブジェクトパラメータ付きデータテーブル
index.js
var options = {};
options.bProcessing = true;
options.bServerSide = true;
options.sAjaxSource = urlContent + 'Employee/GetAll';
options.bPaginate = true;
options.sPaginationType = "full_numbers";
options.iDisplayLength = 10;
options.bAutoWidth = true;
options.aoColumns = cols;
options.fnServerData = function (sSource, aoData, fnCallback) {
$.ajax({
"dataType": 'json',
"type": "GET",
"url": sSource,
"data": aoData,
"success": function (data) { },
"failure": function (data) { }
});
};
options.fnServerParams = function (aoData) {
aoData.push({ "name": "employeeModel", "value": { Name : "testing", Age:25} });
};
var table = $('#' + tableId).DataTable(options);
とMUコントローラ
public JsonResult GetReportData(JQueryDataTableParamViewModel param, EmployeeViewModel employeeModel)
{
return new List<Employee>(); //// Loads from Database
}
employeeModel
は常にnullである、ある作業されていません。私は間違っていた。私を助けてください。