我正在使用KoGrid来制作我的自定义 Ajax 网格。我不知道如何将模型元素传递给一些 Javascrit 方法以生成自定义模板。
我试过这样但不起作用:
PluginGrid.AjaxUrl("MyControler/GetGrid").Columns(
[
{ field: "UserName", displayName: "Model", width: "*", cellClass: "text-center", headerClass: "grid_width_270", cellTemplate: PluginHelpers.HtmlUserInformation($parent.entity, true) },
{ field: "StatusId", displayName: "Status", width: "*", cellClass: "text-center", headerClass: "text-center" }
]).Show("grid");
});
这实际上是 KoGrid 的包装器。我想以某种方式将数据模型传递给我的 Js 方法:
PluginHelpers.HtmlUserInformation($parent.entity, true) }
当我这样做时,我收到了 $parent 变量的一些未定义错误。
请指教,