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 8908553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:12:37+00:00 2026-06-15T03:12:37+00:00

I have a combobox in ExtJS 4 that has two listeners assigned to it.

  • 0

I have a combobox in ExtJS 4 that has two listeners assigned to it. One is on afterrender, to select a default value. (The combobox lists months, the default grid has data for the current month, I want the combobox to show this month.) The other is on select, which goes and gets the report based on the selected month. Since the report gets preloaded, I don’t want it to activate on the prepopulation of the combo box, only on subsequent uses of the combobox (ie, human interaction).

This is how I have the listeners set up:

init: function init() {
    this.control({
        '[xtype=monthcombo]': {
            afterrender: this.onMonthComboAfterRenderDo,
            select: this.onMonthComboSelectDo
        }
    })
}

And this is the prepop afterrender function:

onMonthComboAfterRenderDo: function(monthcombobox) {
    monthcombobox.suspendEvents(false); // Don't fire the select event
    var date = new Date(),
        thisMonth = Ext.Date.add(date, Ext.Date.MONTH,0);
    thisMonth = Ext.Date.format(thisMonth,'Ym');
    monthcombobox.calculateMonths(23,0);
    monthcombobox.setValue(thisMonth);
    monthcombobox.resumeEvents();
}

Oh, I did try suppressing the firing of events as you can see, but those calls don’t seem to actually do anything. Finally, this is the function called when an item is selected.

onMonthComboSelectDo: function(monthcombobox) {
    console.debug('Month selected');
    var monthcode = monthcombobox.getValue();
    var grid = Ext.ComponentQuery.query('shipmentsvsgrid')[0];
    grid.store.getProxy().setExtraParam('monthID', monthcode);
    grid.store.load();
}
  • 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-15T03:12:38+00:00Added an answer on June 15, 2026 at 3:12 am

    A clean alternative would also be to set the value when the reports preload is finished.
    On control initialisation you can set the emptyText to the value you want and that won’t fire anything.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a ExtJs 4 Grid Panel that has two columns. Column ONE
I am using extjs combobox for a sex field. It have two value M
I've made an extended ComboBox based on the one ExtJs features. That's all fine.
I have created one editor grid panel using extjs in that grid panel by
Using EXTJS v4, I want to update the VALUE field of a multi-select combobox
I have two dependent combo-boxes and the value of second one is populated after
i have comboBox that i fill in data like this: SQL = select DISTINCT
i have combobox in datagrid (sourse in mysql (web)) how i can get value
I have a combobox in winforms, which, depending on what you select, determines what's
I have a combobox whose value I want to use with a SQL WHERE

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.