idField String
The name of the Model
ID field. This field is available only if the id
is defined in the Model configuration.
<script>
var Person = kendo.data.Model.define({
id: "personId",
fields: {
"name": {
type: "string"
},
"age": {
type: "number"
}
}
});
var person = new Person({
personId: 1,
name: "John Doe",
age: 42
});
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(person.id); // outputs 1
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(person.idField); // outputs "personId"
</script>