皆さん、こんにちは。MvcJqGrid ( https://github.com/robinvanderknaap/MvcJqGrid ) を使用して、プロジェクトにデータを表示しています。現在の jqgrid 設定を jquery post で渡そうとしていますが、アクション コントローラーで取得できません。GridModelBinder に何か不足しているようです。ここで何が間違っているのか教えてもらえますか..ありがとう
これは私のJavaScriptコードです:
function Export() {
var data = $("#ReportGrid").getGridParam("postData");
$.post('/Home/ExporttoExcel', { gridSettings: data, moduleID: 3 });
}
これは私のアクションコントローラーです:
public FileContentResult ExporttoExcel(GridSettings gridSettings, Int32 moduleID = 0)
{
///Do something with the gridsettings value here.
var encoding = new ASCIIEncoding();
var fileContent = encoding.GetBytes(file.ToString());
return File(fileContent, "application/ms-excel", "List.xls");
}