Results 1 to 5 of 5

Thread: Controller Question - > target view and nested elements

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    255
    Answers
    6
    Vote Rating
    2
      0  

    Question Controller Question - > target view and nested elements

    How do I get my controller to make a change to a view. In my case I want to change the title of a titlebar as the section changes. I have the event happening in the controller fine but I cant seem to do the following

    the controller...
    Code:
    	onTabChange:function(){			alert(this.mainLayout);
    			//console.log(Ext.widget('titlebar').getTitle());
    			var tb=Ext.widget('titlebar');
    			//Ext.widget('titlebar').setTitle('abc')
    	}
    you can see what I'm trying to do from here - thanks. Also handy to know how to hit nested elements that is framework friendly.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    Where is the titlebar in relation to the tabpanel? If it is already created then you need to resolve it.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    255
    Answers
    6
    Vote Rating
    2
      0  

    Default

    The titlebar is actually in the original viewport, but for any controller created with a view by naming convention how would I access the view ?
    T

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    Use ComponentQuery and the convenient methods on each component to move up and down the hierarchy to resolve your titlebar.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  5. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    255
    Answers
    6
    Vote Rating
    2
      0  

    Default Thanks

    console.log(Ext.ComponentQuery.query('#market'));

    errors to Uncaught TypeError: Cannot call method 'query' of undefined

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
  •