Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
ExtJS Grid Filter fires too frequently

I have an ExtJS 6.2 grid using the 'classic' API. I don't do a super-ton of Ext, so please bear with me. But we have a grid we largely re-use over and over in various apps with slight customizations. In one, we have a text field for a filter. But that filter triggers a reload REALLY fast as default behavior. Too fast for someone to type in anything meaningful. I'd like to slow that puppy down. Ideally, I'd like the reload to only happen when the menu is CLOSED, but if I can at least increase the time from someone to type and a reload, I can at least make it reasonable.

Problem is that I've no idea how to do that, and a brief perusal of the helps docs doesn't seem to show me any setting (maybe I'm looking in the wrong place). Any ideas?

The filter is defined as:

{ type: 'string', dataIndex: 'assetId', value: '', active: false }

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need to add a buffer to the change event. That way as long as someone types no event will be handled. Once no one changes the textfield value for 500ms the event will be handled.

controller: 'main',

items: [{
    xtype: 'textfield',
    fieldLabel: 'Filter By Name',
    listeners: {
        change: 'onFilterfieldChange',
        buffer: 500
    }
}]

Controller

Ext.define('MyApp.main.MainController', {
    extend: 'Ext.app.ViewController',
    alias: 'controller.main',

    onFilterfieldChange: function(textfield, newValue) {
        let store = this.getViewModel().getStore('gridStore');
        
        store.clearFilter(true);
        store.setFilter([
            { property: 'firstName', value: newValue}
        ]);
        store.load();
    }
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!