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 })
]
});

猜你喜欢

转载自www.cnblogs.com/Jack-Chang/p/9183747.html
今日推荐