Sha256: 5dddb9700dcefa0876228b2f7b7397a0f8ca7e74fdc6199e92b40661f44f32d3

Contents?: true

Size: 737 Bytes

Versions: 9

Compression:

Stored size: 737 Bytes

Contents

{
  init: function(cmp){
    this.searchControls = cmp.query('field[attr]');

    Ext.each(this.searchControls, function(control){
      var delay = 0;

      if (control.xtype == 'textfield' || control.xtype == 'numberfield') delay = this.delay || 500;

      control.on('change', Ext.Function.createBuffered(function(self){
        var query = this.buildQuery();
        cmp.getStore().getProxy().extraParams.query = [query];
        cmp.netzkeReloadStore();
      }, delay, this));
    }, this);
  },

  buildQuery: function(){
    var query = [];
    Ext.each(this.searchControls, function(f){
      var value = f.getValue();
      if (value) query.push({attr: f.attr, value: value, operator: f.op});
    });
    return query;
  }
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
netzke-basepack-6.5.0.0 lib/netzke/basepack/grid_live_search/client/grid_live_search.js
netzke-basepack-6.5.0.0.rc2 lib/netzke/basepack/grid_live_search/client/grid_live_search.js
netzke-basepack-6.5.0.0.rc1 lib/netzke/basepack/grid_live_search/client/grid_live_search.js
netzke-basepack-1.0.1.0 lib/netzke/basepack/grid_live_search/client/grid_live_search.js
netzke-basepack-1.0.0.1 lib/netzke/basepack/grid_live_search/client/grid_live_search.js
netzke-basepack-1.0.0.0 lib/netzke/basepack/grid_live_search/client/grid_live_search.js
netzke-basepack-1.0.0.0.pre3 lib/netzke/basepack/grid_live_search/client/grid_live_search.js
netzke-basepack-1.0.0.0.pre2 lib/netzke/basepack/grid_live_search/client/grid_live_search.js
netzke-basepack-1.0.0.0.pre lib/netzke/basepack/grid_live_search/client/grid_live_search.js