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

Schema is ignored when setting new data

3 Answers 79 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Lala
Top achievements
Rank 1
Lala asked on 27 May 2014, 09:37 AM
Hi

I just stumbled upon a problem I don't know how to solve: I have a kendo Scheduler with a DataSource, that uses a field-model with relation definitions (f.ex. foo: {from: "Name"}). This works like expected, if the data is delivered by ajax or hard coded when executing the script. But when i set new data (can even be the same as before) with DataSource.data(myData), the relation Model seems not to be used anymore. This is also the case on other widgets. f.ex. I tried this with ListView and a template as well, where the template finds the entry "foo" which was defined as a relation when I create the DataSource, but is missing it, when I set the new data. I double checked the relation definition and could not find an error.

Someone has an idea? Or is this a bug?

3 Answers, 1 is accepted

Sort by
0
Lala
Top achievements
Rank 1
answered on 27 May 2014, 09:39 AM
Kendo UI Web v2013.3.1119 but works also in current Dojo
0
Alexander Valchev
Telerik team
answered on 29 May 2014, 08:31 AM
Hello Patric,

The behavior you described is expected - when the data is passed through the data method it will be processed via model parser. In other words the dataSource expects already parsed and ready-to-use objects.
If possible please try to manually parse the data objects before passing them to the data method (e.g. instead of having "Name": "Name 1" directly change it to "foo": "Name 1"). In case this approach does not fit in your scenario please provide a better description of your scenario (why data is first loaded via Ajax transport and after that replaced via data method) so I can advice you accordingly.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Lala
Top achievements
Rank 1
answered on 02 Jun 2014, 06:24 AM
Hi Alexander

Thank you for your help. In this case I will have to way until I can call the data by ajax (testing with local objects at the moment). But this is a good thing to know for me :)

Regards,
Patric
Tags
Data Source
Asked by
Lala
Top achievements
Rank 1
Answers by
Lala
Top achievements
Rank 1
Alexander Valchev
Telerik team
Share this question
or