This is a migrated thread and some comments may be shown as answers.

id field on Model

1 Answer 71 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 11 Dec 2013, 05:10 AM
I've noticed that when you map the id of the model to a different field (e.g.   id: "personID") , the resulting object will actually possess still possess the ID field as well as whatever it was assigned to.

e.g. using the personID example

var test = kendo.data.Model.define({id: "personID"});
t = new test();
Results in: 
{personID: "", uid: "a30e1c16-fc65-4345-980c-4d5ad527348c", dirty: false, id: ""}

My question is what it the use of the id field versus the personID field.  I've noticed the framework updates both fields upon a successful post back. but also that the isNew() function only tiggers of the id field... not the personID field.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 12 Dec 2013, 01:30 PM
Hello Mark,

The id field is intended for internal use. It is used to access the id value no matter what is the name of the ID field in the data.

Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Mark
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or