I have what I believe is a fairly common and straight-forward scenario that I am trying to figure out with Kendoui Mobile:
First I display a ListView is retrieves data from a Web Service via the Datasource object to display a list of Customers. I use a template here to add a link:
When you click on a customer, I navigate to a new MobileView called CustomerDetailView - where I would like to display the following:
Customer Name, Address and other simple information
List of Contacts (in a ListView)
List of Sales (also in a ListView)
I can't seem to find an example that shows how this would work. Here is where I am at right now:
And on the show event of the MobileView I retrieve the data:
Attached is a screenshot of part of the JSON data that is returned by the web service, to give you an idea what I am dealing with here.
First I display a ListView is retrieves data from a Web Service via the Datasource object to display a list of Customers. I use a template here to add a link:
<
script
id
=
"MyCustomersTemplate"
type
=
"text/x-kendo-template"
>
<
a
href
=
"CustomerDetailView?ID=#= ID #"
>
<
div
style
=
"font-weight:bold;"
>#= Name #</
div
>
<
div
style
=
"font-weight:normal;font-size:smaller"
>#= City #, #= State #</
div
>
</
a
>
</
script
>
When you click on a customer, I navigate to a new MobileView called CustomerDetailView - where I would like to display the following:
Customer Name, Address and other simple information
List of Contacts (in a ListView)
List of Sales (also in a ListView)
I can't seem to find an example that shows how this would work. Here is where I am at right now:
<
div
data-role
=
"view"
data-transition
=
"overlay"
data-title
=
"Customer Detail"
id
=
"CustomerDetailView"
data-show
=
"getCustomer"
>
<!-- What Do I put here ?? -->
</
div
>
And on the show event of the MobileView I retrieve the data:
function
getCustomer(e) {
var
wsParams = {
"ID"
: e.view.params.ID
};
var
dsCustomerDetail =
new
kendo.data.DataSource({
transport: {
read: {
type:
"POST"
,
contentType:
"application/json; charset=utf-8"
,
url: virtualDirectory +
"/CRM/GetClientInfo.asmx/Read"
,
dataType:
"json"
,
data: { callParams: wsParams }
},
parameterMap:
function
(options) {
return
kendo.stringify(options);
}
},
schema: {
data:
"d"
// How do I setup the Datasource to expose multiple collections (i.e Contacts and Sales) from this web service, without having to call it multiple times for each control databind?
}
});
// How do I now get this data onto the MobileView? Can I use a Template?
}
Attached is a screenshot of part of the JSON data that is returned by the web service, to give you an idea what I am dealing with here.