2015-09-18 47 views
0

我正在使用Kendo Grid来保持表格中的CRUD。我在我的表中有外键,我想用网格而不是键值显示实际值。所以我创建了自定义函数“getProductName”。有了这个表格而不是ProductId,这是我的表格,我从父表格中选取产品名称。模板中的自定义函数Kendo Grid

$("#Grid").kendoGrid({ 
     columns: [ 
      { field: "FieldId", title: "FieldId" }, 
      { 
       field: "Product", title: "Product Name", editor: productdropdowneditor, template: **getProductName**, 
       width: "auto", filterable: { ui: productFilter } 
      }, 
      { field: "FieldName", title: "FieldName" } 
      { command: ["edit", "destroy"], title: " ", width: "175px", locked: true } 
     ], 

现在我的问题是这样的函数被调用为每行,每一次创建,编辑和删除发生这是使我的网页很慢。我能做什么?

回答

0

您可以在DTO中创建对象字段,并在服务器上选择“productName”和“productId”。

在客户端:

{ field: "Product.productName", title: "Product Name", editor: productdropdowneditor }