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