Reputation: 648
I have a list in Sencha Touch, and I need to get different records for each item list it is very important have in mind for each item list I have a button, showing in the inside of a modal window other list with the "templates" records.. (I will try to explain me with the code..)
{
"id" : "0100144200",
"address" : "hello street,Hamm",
"openSurveys" : 1,
"type" : 0,
"withSurveys" : true,
"templates": {
"results": [
{
"id": "0000000772",
"name": "TEST GENERAL AV 1"
},
{
"id": "0000000799",
"name": "TEST_TEMPLATE2"
}
]
}
}
I am receiving this object for each item list, and I need to include in a modal window data included in the templates object.. How to detect in the list id number and related templates?
Thank you!!
Upvotes: 0
Views: 87
Reputation: 2536
While I'm not 100% sure exactly what you want, I start with my assumption: you have a list and when tap on it you want to show the child templates in a floating, modal panel in maybe another list?
Here is a fiddle that uses hasMany association to read the child templates and the two lists: https://fiddle.sencha.com/#fiddle/11v5
The important piece is the hasMany
config in the Fiddle.model.Something
model. Then in the itemtap
event of the main list, I get the templates from the association and simply show a floating list for the templates.
Upvotes: 1