Results 1 to 4 of 4

Thread: controller control refers to which view

  1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    425

    Default controller control refers to which view

    Hi,
    Let's say my controller is configured with 2 views: V1 and V2.
    Both have a button.
    In my control section, how can I setup a handler for the tap event of the button in V1?

    Moreover, which view's button will the code below listen to?
    Code:
    control: {
                    'button': {
                        tap: 'onLogin'
                    }
            }

  2. #2
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120

    Default

    Quote Originally Posted by raj_plays View Post
    Hi,
    Let's say my controller is configured with 2 views: V1 and V2.
    Both have a button.
    In my control section, how can I setup a handler for the tap event of the button in V1?

    Moreover, which view's button will the code below listen to?
    Code:
    control: {
                    'button': {
                        tap: 'onLogin'
                    }
            }
    Your current listener will fire for *all* button events. To target specific buttons, or buttons in certain contexts, you'll want to provide a more specific selector:

    Examples:

    'V1 button' (matches any buttons within the V1 reference)
    'button#firstbutton' (matches any buttons that have an itemId of 'firstbutton')

    Thanks!
    Joel

  3. #3
    Sencha User
    Join Date
    Dec 2009
    Posts
    425

    Default

    Thanks, Joel.
    I needed to know if a conflict error will be thrown or if both the buttons will be handled.

  4. #4
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120

    Default

    Quote Originally Posted by raj_plays View Post
    Thanks, Joel.
    I needed to know if a conflict error will be thrown or if both the buttons will be handled.
    As currently written, your listener will fire for *all* buttons in your application.

    Thanks
    Joel

Similar Threads

  1. Replies: 2
    Last Post: 9 Jun 2015, 11:12 PM
  2. Replies: 1
    Last Post: 29 Jul 2014, 6:23 AM
  3. Controller control does not allow Controller refs
    By confile in forum Sencha Architect 2.x: Bugs
    Replies: 5
    Last Post: 21 Nov 2012, 9:11 PM
  4. Replies: 1
    Last Post: 26 Jul 2012, 4:24 AM
  5. [CLOSED] Controller control does not allow Controller refs
    By confile in forum Sencha Architect 2.x: Bugs
    Replies: 5
    Last Post: 5 Jun 2012, 10:22 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •