Results 1 to 3 of 3

Thread: Fire an event from view to the controller

  1. #1
    Sencha Premium User
    Join Date
    May 2013
    Vote Rating

    Default Fire an event from view to the controller

    I have a view component with an attribute set as following

    config : {
    myattribute : 22

    I know this will make extjs generate auto getter and setter methods for it.
    Now I would like to notify the view's controller ( when the value of myattribute is changed via its setter method.
    What would be the best method to achieve this?
    If I fire en event from the updateMyAttribute method will it be listened too by all the application controllers?


  2. #2
    Ext Team Member
    Join Date
    Sep 2017
    Vote Rating


    Hi there- thank you so much for your question. I have sent this over to the support team to look into. We will get back with you at our earliest convenience. I appreciate your patience!


  3. #3
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Goiânia - GO, Brazil
    Vote Rating


    Hi dmifs , eventedConfig do the trick

    Ext.define('MyApp.util.Test', {
    extend: 'Ext.Evented',
    eventedConfig: {
    foo: null
    var test = Ext.create('MyApp.util.Test', {
    listeners: {
    beforefoochange: function (instance, newValue, oldValue) {
    return newValue !== 'bar';
    foochange: function (instance, newValue, oldValue) {
    console.log('foo changed to:', newValue);
    Wemerson Januario @JanuarioCoder
    Novanti Tecnologia, Sencha MVP/ Ext JS Consultant
    Hire me on UpWork:


    Treinamento e Consultoria Ext JS. QUALIFIQUE-SE JÁ!

Similar Threads

  1. Replies: 1
    Last Post: 20 Sep 2017, 8:02 AM
  2. Replies: 1
    Last Post: 28 Jan 2017, 7:55 PM
  3. How to fire an event from a controller and listen to it from another one?
    By fenderico in forum Sencha Touch 2.x: Discussion
    Replies: 2
    Last Post: 2 Jul 2012, 6:28 AM
  4. Application reference required in the view to fire an event from a view.
    By bweiler in forum Sencha Touch 2.x: Discussion
    Replies: 3
    Last Post: 9 Feb 2012, 10:25 AM
  5. fire event from a controller to b controller
    By linuxyf in forum Sencha Touch 2.x: Discussion
    Replies: 1
    Last Post: 16 Jan 2012, 6:28 AM

Posting Permissions

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