1. #1
    Touch Premium Member hotdp's Avatar
    Join Date
    Nov 2010
    Location
    Denmark
    Posts
    603
    Vote Rating
    14
    hotdp will become famous soon enough

      0  

    Default ControllerAction working on more then one component

    ControllerAction working on more then one component


    Hi,
    I have x lists and would like the same ControllerAction to work with them all.
    So looking at:
    http://docs.sencha.com/touch/2-0/#!/...y-method-query

    I thought I could do something like.
    controlQuery:
    listOne, listTwo

    But this gives me a Sencha JSON error when clicking on one of the lists.

    What is the correct syntax fot this in Architect?

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default


    Hi,

    Whats your exact query line? Just specifying 'list' in controlQuery(the xtype) should match all lists.

    Regards
    Bharat Nagwani
    Sencha Designer Development Team

  3. #3
    Touch Premium Member hotdp's Avatar
    Join Date
    Nov 2010
    Location
    Denmark
    Posts
    603
    Vote Rating
    14
    hotdp will become famous soon enough

      0  

    Default


    I don't want it to hit ALL list but the lists I specify by xtype or ID.

  4. #4
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default


    Are you using exactly as 'listOne, listTwo' or '#listOne, #listTwo'
    Bharat Nagwani
    Sencha Designer Development Team

  5. #5
    Touch Premium Member hotdp's Avatar
    Join Date
    Nov 2010
    Location
    Denmark
    Posts
    603
    Vote Rating
    14
    hotdp will become famous soon enough

      0  

    Default


    I have tried both. If I only use one it works. If I choose both with "," I get a sencha runtime error.

  6. #6
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default


    Are both lists visible in the dom?

    Use # to match the Id's
    Ext.ComponentQuery.query("#id1,#id2")

    I just tried a formPanel with 2 textfields with Ids and it returns both fields.
    Bharat Nagwani
    Sencha Designer Development Team

  7. #7
    Touch Premium Member hotdp's Avatar
    Join Date
    Nov 2010
    Location
    Denmark
    Posts
    603
    Vote Rating
    14
    hotdp will become famous soon enough

      0  

    Default


    Quote Originally Posted by bharatn View Post
    Are both lists visible in the dom?

    Use # to match the Id's
    Ext.ComponentQuery.query("#id1,#id2")

    I just tried a formPanel with 2 textfields with Ids and it returns both fields.
    That's my point! It works fine there but I would like to use it with architect and controlleraction? That's where it fails.

  8. #8
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default


    I will get some details tomorrow. Most likely its not going to be possible since the controller action gets init'ed as soon as first component is initialized when you use id.

    What i did was add custom property (or use a standard property if there are similarities between the 2 lists)
    and added list[prop=value] in the control query and that worked
    Bharat Nagwani
    Sencha Designer Development Team

Thread Participants: 1