Results 1 to 2 of 2

Thread: Better syntax to programmatically call a view controller method by name?

  1. #1
    Sencha Premium User SebTardif's Avatar
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,294
    Answers
    16

    Default Better syntax to programmatically call a view controller method by name?

    I have a button like:
    Code:
    {
    	xtype : 'button',
    	text : 'OK',
    	handler : function(toolbar, event){
                // do something before calling view controller by name (onOkOptions)
    	    Ext.callback('onOkOptions', toolbar.scope || toolbar.origScope, arguments, undefined, this);
    	}
    }
    Do we have a better syntax that this very long Ext.callback to be able to ask the code to find the viewcontroller and call it's method by name?

    I know Sencha code use the same very long method, it looks wrong, and even if it work I don't understand the parameters...

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    Why can't you set handler to a string?

    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Similar Threads

  1. ExtJs5: Call Controller 2's method from Controller 1
    By gaurav.varshikar in forum Ext 5: Q&A
    Replies: 24
    Last Post: 15 Apr 2016, 12:23 AM
  2. How controller call function from view controller
    By elijah.zhao in forum Ext 5: Q&A
    Replies: 3
    Last Post: 23 Jun 2014, 5:50 PM
  3. Call a method in a controller
    By dblv in forum Ext: Discussion
    Replies: 2
    Last Post: 30 Oct 2012, 11:43 PM
  4. Replies: 1
    Last Post: 26 Jul 2012, 4:24 AM
  5. never, ever call a controller method from a view
    By fordprefect in forum Ext: Q&A
    Replies: 7
    Last Post: 15 May 2012, 6:50 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
  •