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

Calling .get(id) does not return expected Model instance

2 Answers 109 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Richard H
Top achievements
Rank 1
Richard H asked on 05 Mar 2012, 06:47 PM
Hi There,

I am unable to determine how to use the .get() method on the DataSource object to retrieve a Model instance. Whenever I call the .get() method and pass it a value, an 'undefined' object is always returned.

I have attached complete sample files which can be used to reproduce the problem.
if (viewID === "poDetails-view") {
    var poNumber = getQueryStringParam("PO");
     
    po = ds.get(poNumber); /**** ALWAYS RETURNS 'undefined' ****/
     
    view.content.data("kendoMobileScroller").scrollElement.html(poDetailsTemplate(po));
    kendo.mobile.enhance(view.content);
}

Thanks,
Richard

2 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 06 Mar 2012, 10:28 AM
Hi Richard,

The issue you have described is related to the model id declaration, which in this case will not work as expected. However, we have addressed this by adding support for setting the id to be a field from the processed data in case XML data is used. This improvement will be included in the Q1 2012 official release.

All the best,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Richard H
Top achievements
Rank 1
answered on 07 Mar 2012, 09:46 PM
Thanks. I thought I was going crazy for a while there. I'll look forward to the fix in the next release.
Tags
Data Source
Asked by
Richard H
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Richard H
Top achievements
Rank 1
Share this question
or