1. #1
    Sencha User
    Join Date
    Sep 2007
    Posts
    118
    Vote Rating
    0
    stratboogie is on a distinguished road

      0  

    Default Controller Event question

    Controller Event question


    hello,
    I am creating a Ext.Application that creates a Viewport that Contains a view of aPanel (MainPanel). In defining the Application I give the controllers. inside my panel I have a tbar that has a menu of buttons like so:

    Code:
    tbar: [
    		{
    			text: "Action Menu",
    			menu: [{ text: 'InstructionManagement', action: '1' }, { text: 'ProductManagement', action: '2' }]
    		}
    	]
    In the controller for the MainPanel, I can capture the events for the Panel and any buttons I directly place in the panel, or on the tbar. but what I cannot capture are the events from the buttons inside the menu.

    I have tried:

    Code:
    'MainView > menu button[action=1]': {
    				click: this.showInstructionManagement
    			}
    'MainView > tbar > menu button[action=1]': {
    				click: this.showInstructionManagement
    			},
    'MainView button[action=1]': {
    				click: this.showInstructionManagement
    			},
    but none of those works. Can someone please tell me the proper way to do this.

    thx
    Timothy

  2. #2
    Sencha User
    Join Date
    Sep 2007
    Posts
    118
    Vote Rating
    0
    stratboogie is on a distinguished road

      0  

    Default


    Any suggestions?

  3. #3
    Sencha User atian25's Avatar
    Join Date
    Oct 2008
    Location
    china
    Posts
    114
    Vote Rating
    2
    atian25 is on a distinguished road

      0  

    Default


    MainView ?

  4. #4
    Sencha User
    Join Date
    Sep 2007
    Posts
    118
    Vote Rating
    0
    stratboogie is on a distinguished road

      0  

    Default


    Yeah, MainView is the alias to my Panel. I can create even handlers via the controller for the MainPanel and buttons placed directly on the "MainPanel" but I havent figured out to access them when they are nested inside a tbar and menu.

  5. #5
    Sencha User atian25's Avatar
    Join Date
    Oct 2008
    Location
    china
    Posts
    114
    Vote Rating
    2
    atian25 is on a distinguished road

      0  

    Default


    alias:'widget.MainView' ?

  6. #6
    Sencha User
    Join Date
    Sep 2007
    Posts
    118
    Vote Rating
    0
    stratboogie is on a distinguished road

      0  

    Default


    Yes, that is the alias I give my Panel in the view. And when I attach event listeners in the controller they work using: "MainPanel": evenname: methodtocall. But the problem lies in when I try to attach an eventlistener to a menu button contained in the menu in the tbar of the MainPanel. make sense?

  7. #7
    Sencha User
    Join Date
    Mar 2008
    Posts
    53
    Vote Rating
    2
    manilodisan is on a distinguished road

      0  

    Default


    have the same problem in another thread for days. theres no documentation yet telling you how to reach a component. I believe it uses some type of css selector but can't get it working either. Maybe a dev will care to answer and ease our path a little bit.

  8. #8
    Sencha User
    Join Date
    Sep 2007
    Posts
    118
    Vote Rating
    0
    stratboogie is on a distinguished road

      0  

    Default


    Yeah, I agree. I have tried quite a few different ways and none have worked. The examples they have in the documentation are very simple. I would think have some type of drop down menu inside of a panel's tbar is going to be very common. So yes, hopefully a dev will come along and answer our question

  9. #9
    Sencha User
    Join Date
    Sep 2007
    Posts
    118
    Vote Rating
    0
    stratboogie is on a distinguished road

      0  

    Default


    ok, so the proper way add a listener for the a menuitem nested inside of a panel's toolbar bar is:

    Code:
    init: function () {
    		this.control({
    			"MainView > toolbar > button > menu > menuitem[text=Customer Search]": {
    				click: function (item, eventObj) {
    					alert(item.text);
    				}
    			}
    		});
    	}
    where MainView is the alias for your panel

  10. #10
    Sencha User
    Join Date
    Sep 2007
    Posts
    118
    Vote Rating
    0
    stratboogie is on a distinguished road

      0  

    Default


    also, I am looking for the text property, but that is interchangeable with any other property as well. i.e. action

Similar Threads

  1. Event Question
    By Bleak in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 8 Jun 2010, 11:10 AM
  2. Event Question
    By Bleak in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 6 May 2010, 6:51 AM
  3. Grid Sort - Disabled by Controller-Event
    By Michi_de in forum Ext GWT: Help & Discussion (1.x)
    Replies: 15
    Last Post: 11 Dec 2008, 2:23 AM
  4. event question?
    By skyey in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 20 Jun 2007, 3:44 AM
  5. loading event question
    By heidtmare in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 14 Apr 2007, 1:21 AM

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar