简体   繁体   中英

How to filter by id in a list with Sencha touch app

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!!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM