Hi there,
I am trying to map a field defined in my datasource schema to the unique Model instance id property. However, after I do this the field in the model no longer displays correctly when the datasource is bound to a list. The value for "PONumber" field is always 'Undefined' after this mapping is defined. If I comment out the line which maps the "PONumber" field to id, the expected value from the "PONumber" field shows up in the output. However, because there is no id mapping which uniquely identifies the Model instance calls like get(id) won't work.
[Edit: I am using 2012.1.229.beta]
Here is the code I'm using (see attachment for code and sample data file):
Any ideas what is happening here?
I am trying to map a field defined in my datasource schema to the unique Model instance id property. However, after I do this the field in the model no longer displays correctly when the datasource is bound to a list. The value for "PONumber" field is always 'Undefined' after this mapping is defined. If I comment out the line which maps the "PONumber" field to id, the expected value from the "PONumber" field shows up in the output. However, because there is no id mapping which uniquely identifies the Model instance calls like get(id) won't work.
[Edit: I am using 2012.1.229.beta]
Here is the code I'm using (see attachment for code and sample data file):
<!DOCTYPE html>
<
html
>
<
head
>
<
title
>Repro</
title
>
<
script
src
=
"js/jquery.min.js"
></
script
>
<
script
src
=
"source/js/kendo.all.js"
></
script
>
<
link
href
=
"source/styles/kendo.common.css"
rel
=
"stylesheet"
/>
<
link
href
=
"source/styles/kendo.mobile.all.css"
rel
=
"stylesheet"
/>
</
head
>
<
body
>
<
div
data-role
=
"view"
id
=
"tabstrip-listview"
data-init
=
"initList"
data-title
=
"PO List"
data-layout
=
"tabstrip-layout"
>
<
ul
id
=
"po-listview"
/>
</
div
>
<
script
>
var app = new kendo.mobile.Application(document.body);
var ds = new kendo.data.DataSource({
transport: {
read: "Data/POListTest.xml"
},
schema: {
type: "xml",
data: "/ItemInfoList/ItemInfo",
model: {
id: 'PONumber', // *** Commenting out this line fixes the problem ***
fields: { PONumber: "Item/PurchaseOrderHeader/POHdrPONumber/text()" }
}
}
});
function initList() {
$("#po-listview").kendoMobileListView({ dataSource: ds, template: "${PONumber}" });
};
</
script
>
</
body
>
</
html
>
Any ideas what is happening here?