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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:13:01+00:00 2026-06-12T01:13:01+00:00

I created a store using ExtJs and i want to load the value of

  • 0

I created a store using ExtJs and i want to load the value of store to ComboBox. But before loading values i need to filter some data based on value selected in another comboBox.

So for that purpose i think i need to apply filter on store, please any body can help me how i can do that.

Model:-

Ext.define('City', {
extend: 'Ext.data.Model',
fields: [
        { name: 'StateId', type: 'string' },
        { name: 'City', type: 'string' },
]});

Store:-

var cityStore = Ext.create('Ext.data.Store', {
model: 'City',
data : [
    { StateId: '1', City: 'Bangalore'},
    { StateId: '1', City: 'Mysore'},
    { StateId: '1', City: 'Dharwad'},
    { StateId: '2', City: 'Mumbai'},
    { StateId: '2', City: 'Pune'},
    { StateId: '2', City: 'Nagpur'}
   ]});

Now i am using this cityStore to load in Combobox. but before load i want if stateId is 1 then only 3 records (Bangalore, Mysore, Dharwad) are load in combobox and if stateId is 2 then other 3 records are load in combobox. How i can achive it.

  • 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-12T01:13:03+00:00Added an answer on June 12, 2026 at 1:13 am

    According to Ext.data.Store filter method documentation:

    var stateId = 1; // your value
    cityStore.clearFilter(true);
    cityStore.filter('StateId', stateId);
    

    Update

    I’ve found that ComboBox filters data by itself and there is no opportunity to change it’s behaviour. But I see two solutions of this problem:

    1. Filter data manually (see Ext.util.MixedCollection filter) and load it into your store (see Ext.data.Store load)

    2. Disable store’s clearFilter and filter methods and use own cityFilter:

      Ext.define('CityStore', {
          extend: 'Ext.data.Store',
          filter: Ext.emptyFn,
          clearFilter: Ext.emptyFn,
          cityFilter: function (stateId) {
              Ext.data.Store.prototype.clearFilter.call(this);
              Ext.data.Store.prototype.filter.call(this, 'StateId', stateId);
          }
      });
      

      Then use cityFilter() method.

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

Sidebar

Related Questions

Using EXTJS v4, I want to update the VALUE field of a multi-select combobox
I'm a newbie using Extjs 4.07. I have created a combobox (remote) queryMode. The
I'm using PHP/MySQL and I've always used DATETIME to store created and updated values,
i was using extjs for an application but when i verified some of the
Where does Railo store files created by when using the file attribute? I.e. <cflog
I am trying to implement Ext.ux.grid.filter.ListFilter using a data store (rather than a hardcoded
I have created in-app purchase for non-consumable object application in iPhone using with store
I created a grid using extjs library. First created a model: Ext.define('Option', { extend:
I was trying to render a simple piechart using ExtJs 3.0 but could not.
I'm using Sencha touch 2. I have store that load from existing js object:

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.