Kendo 计算字段

var Product = kendo.data.Model.define({
fields: {
"quantity": {
type: "number"
},
"price": {
type: "number"
}
},
total: function() { //define the calculated field
return this.get("quantity") * this.get("price");
},
t:function(){
var p={p2:this.get("price")};
return p.p2;
}
});

var viewModel = kendo.observable({
data: [
new Product({ "quantity": 1, "price": 2 })
]
});

posted @ 2018-06-14 16:41  玛雅人  阅读(120)  评论(0编辑  收藏  举报