To simplify KendoUI development we have defined nesterovskyBros.data.Model, which extends kend.data.Model class.
nesterovskyBros.data.Model
kend.data.Model
kendo.data.Model
fields
fields.fieldName.serializable Boolean
model.toJSON()
true
fields.fieldName.updateDirty Boolean
dirty
model.set()
Here is an example of a model:
nesterovskyBros.data.ProductModel = nesterovskyBros.data.Model.define( { fields: { name: { type: "string", defaultValue: "Product Name" }, price: { type: "number", defaultValue: 10 }, unitsInStockValue: { type: "number", defaultValue: 10, serializable: false }, unitsInStock: { type: "string" } }, unitsInStock: function(value) { if (value === undefined) { var count = this.get("unitsInStockValue"); return ["one", "two", "three", "four"][count] || (count + ""); } else { this.set("unitsInStockValue", ({one: 1, two: 2, three: 3, four: 4 })[value] || value); } } });
Notice that:
unitsInStock
JSON.stringify()
name
price
sessionStorage
var model = new nesterovskyBros.data.ProductModel({ price: "7", unitsInStock: "one" });
(typeof(model.price) == "number") && (mode.price == 7) && (model.name == "Product Name") && (model.unitsInStockValue == 1)
As with UserControl the implemntation is defined in the controls.js. The sample page is the same index.html
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u