2016-12-15 72 views
1

我有一个kendo网格,我在模式模型中指定它的类型。如何在剑道网格中指定模式模型中的多个类型?

下面是我的架构模型

schema: { 
        model: { 
         fields: { 
          UOMName: { type: "string" }, 
          ConversionFactor: { type: "string" }, 
         } 
        } 
} 

我想ConversionFactor类型是一个场景,编号为另一种情形字符串。

有没有什么办法可以在kendo架构模型中指定多个类型?

回答

1

没有办法为同一个Kendo UI数据源指定两个不同的schema。你可以做的是有两个单独的(几乎相同的)DataSource实例,并在需要时通过setDataSource方法在它们之间切换。

var dataSource1 = new kendo.data.DataSource({ /* ... */ }); 
var dataSource2 = new kendo.data.DataSource({ /* ... */ }); 

// create the Grid with the first dataSource 
$("#grid").kendoGrid({ 
    dataSource: dataSource1 
}); 

// some time later, switch to the second dataSource 
$("#grid").data("kendoGrid").setDataSource(dataSource2); 
+0

感谢您的回复。将尽力遵循 – RamaChandran

相关问题