Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8497871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:14:55+00:00 2026-06-11T00:14:55+00:00

I have this gridPanel: Ext.define(‘BM.view.test.MacroList’, { extend: ‘BM.view.GridPanel’, alias:’widget.macro-test-list’, store: ‘Tests’, initComponent: function() {

  • 0

I have this gridPanel:

Ext.define('BM.view.test.MacroList', {
extend: 'BM.view.GridPanel',
alias:'widget.macro-test-list',

store: 'Tests',

initComponent: function() {

    this.columns = [
        {
            xtype:'actioncolumn',
            width:50,
            items: [
            {
                icon: 'images/start.png',
                tooltip: 'Start Test',
                handler: function(grid, rowIndex, colIndex) {
                    this.application.fireEvent('testStart', grid.getStore().getAt(rowIndex)); 
                // application not defined here because 'this' is the button.
                }]
     }]
}
}

stratTest is a function that will be available from many places in the application, and I would like it to be used as an application wide event, but those seem to be available only from controllers.
How do I call .application.fireEvent('testStart'...) from the handler inside this button?

I’m using this question as a constant reference to events, and the Sencha docs, but couldn’t find the answer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:14:57+00:00Added an answer on June 11, 2026 at 12:14 am

    You get this.application within a controller scope.

    Given you are clearly using MVC here, I’d say it’s best to stick to MVC concepts; that is, for reusability sake, a component shouldn’t know what controller uses it, but rather a controller should know what components it is using.

    So you should really listen to the event in the controller, and fire an application event from there.

    The problem is that there’s no access to the actioncolumn handler from the controller (it is called internally in Ext.grid.column.Action processEvent()).

    So your best shot is to fire a new event in the view:

    this.columns = [
        {
            xtype:'actioncolumn',
            ...
            items: [
            {
                ...
                handler: function( aGrid, aRowIndex, aColIndex, aItem, aEvent, aRecord ) {
                    this.fireEvent( 'columnaction', aGrid, aRowIndex, aColIndex, aItem, aEvent, aRecord); }
            }]
     }]
    

    Notice also that you can define a global handler for the column, like so:

    this.columns = [
        {
            xtype:'actioncolumn',
    
            handler: function( aGrid, aRowIndex, aColIndex, aItem, aEvent, aRecord ) {
                this.fireEvent( 'columnaction', aGrid, aRowIndex, aColIndex, aItem, aEvent, aRecord); }
    
            ...
            items: [
            {
                ...
            }]
     }]
    

    And then catch this event in the controller.

    init: function() {
        this.control({
            'macro-test-list actioncolumn':{
                columnaction: this.onAction
            }
        });
    },
    
    onAction: function( aGrid, aRowIndex, aColIndex, aItem, aEvent, aRecord ) {
        this.application.fireEvent( 'testStart', aGrid.getStore().getAt( aRowIndex ) );
    }
    

    Notice, by the way, that given what you are trying to do, a cleaner code would be:

    onAction: function( aGrid, aRowIndex, aColIndex, aItem, aEvent, aRecord ) {
        this.application.fireEvent( 'testStart', aRecord );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a grid panel like this Ext.define('sCon.view.SalesGrid',{ extend: 'Ext.grid.GridPanel', title: 'Sales Data', //other
I have grid something like this: Ext.define('Exp.view.dashboard.Tv', { extend: 'Ext.grid.Panel', initComponent: function() { this.columns
thanks to the help of some of you i have this: Ext.define('PersistantSelectionGridPanel', { extend:
I have a GridPanel in EXTJS4 with JSONstore. Like this: var storeGridSpe = Ext.create('Ext.data.JsonStore',{
I have a storage with models: Ext.define('App.Supplier.Store', { extend : 'Ext.data.Store', constructor : function(config)
I have this ASP code: <ext:GridPanel ID=grid> <ColumnModel runat=server> <Columns> <ext:RowNumbererColumn /> <ext:Column Align=Center
Situation Overview I'm using Ext.NET GridPanel to display a list of projects which has
I have a gridpanel that allows inline editing of a column. This column uses
I have 'Movie' model and hold data in Ext.data.Store. Movies are displayed in gridPanel.
I have an ext js grid like below: var grid = new Ext.grid.GridPanel({ columns:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.