1

I made a bar column chart using ExtJs mvc. Now in the controller I want to add a function for click event to catch the selected value of the column. Here is my controller code:

Ext.define('Gamma.controller.ControlFile', {

  extend : 'Ext.app.Controller',

  //define the stores
  stores : ['BarColumn','RadarView','VoiceCallStore','SMSCallStore','MMSCallStore','GPRSUsageStore'],
  //define the models 
  models : ['BarCol','radar','VoiceCallModel','SMSCallModel','MMSCallModel','GPRSUsageModel'],
  //define the views
  views : ['BarColumnChart','LineChart','RadarChart','VoicePie','SMSPie','MMSPie','GPRSPie'],

  init : function() { 
    this.control({

    });
  }
});

Please any one help me.

1

1 Answer 1

1
  • On chart:
listeners : {

    itemmousedown : function(obj) {

               this.fireEvent('itemmousedownchartbar',obj);

        }
}

At final on chart defined, after this.CallParent():

this.addEvents('itemmousedownchartbar');
  • Now, on Controller:
'barChartView' : {

     itemmousedownchartbar: this.function_to_call

}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.