1. #61
    Sencha User tdikarim's Avatar
    Join Date
    Jun 2007
    Location
    Belgium - Brussel
    Posts
    142
    Vote Rating
    0
    tdikarim is an unknown quantity at this point

      0  

    Default cls on input field

    cls on input field


    Hi,

    Great plugin. Thanks for sharing.

    I want to apply a cls for the input field contained in the header. How to apply it ?

    Thanks
    Tamditi Karim

  2. #62
    Ext JS Premium Member
    Join Date
    Apr 2007
    Posts
    291
    Vote Rating
    0
    jheid is on a distinguished road

      0  

    Default


    For supporting combo boxes I added
    PHP Code:
    if (filterField.xtype == 'combo')
              
    filterField.on ('change'this.onFilterContainerEnterthis); 
    at the end of

  3. #63
    Sencha User
    Join Date
    Apr 2011
    Location
    Bamberg Germany
    Posts
    26
    Vote Rating
    0
    dotti is on a distinguished road

      0  

    Default


    Hi,

    is there a Verion for ExtJS 4.2.0

    mfg

    Klaus

  4. #64
    Ext JS Premium Member
    Join Date
    Sep 2008
    Location
    Raleigh, NC
    Posts
    145
    Vote Rating
    5
    qooleot is on a distinguished road

      1  

    Default


    It works in 4.2 after I changed this in two places:

    var columns = this.grid.headerCt.getGridColumns(true);

    to this:

    var columns = this.grid.headerCt.getGridColumns();

    I'll need to go figure out what the 'true' was for and test with nested headers and other things though...but a few basic filters on a basic grid works.

  5. #65
    Sencha User
    Join Date
    Mar 2010
    Posts
    2
    Vote Rating
    0
    mikegk is on a distinguished road

      0  

    Default Great tip - thanks a lot!

    Great tip - thanks a lot!


    Applied now your fix - and it works like a dream!

  6. #66
    Sencha User
    Join Date
    Sep 2011
    Posts
    11
    Vote Rating
    0
    linyajun is on a distinguished road

      0  

    Default


    great plugin!
    but it have some problem in ie with extjs4.2.
    when grid columns text is all English or chinese it used perfect.
    some problem show when columns have english and chinese text,then english
    column does not show filter.like1.gif


    Ext.define('Ext.ux.grid.plugin.HeaderFilters', {
    extend : 'Ext.AbstractPlugin',
    mixins : {
    observable : 'Ext.util.Observable'
    },
    containers : {},
    stateful : false,
    booleanSotre : {
    fields : [ 'name', 'value' ],
    data : [ {
    "name" : "--",
    "value" : ""
    }, {
    "name" : "true",
    "value" : "true"
    }, {
    "name" : "false",
    "value" : "false"
    } ]
    },
    init : function(grid) {
    this.fields = [];
    this.grid = grid;
    this.grid.filterContainers= {};
    this.grid.filterFields = [];
    if(grid.lockable === true){
    this.columns = Ext.Array.union(this.grid.normalGrid.columns,this.grid.lockedGrid.columns);
    this.grid.normalGrid.headerCt.on({scope : this,afterrender : this.renderFilters});
    }
    else{
    this.columns = this.grid.columns;
    this.grid.headerCt.on({scope : this,afterrender : this.renderFilters});
    }
    this.grid.on({
    scope : this,
    columnresize : this.resizeFilterContainer,
    afterlayout : this.adjustFilterWidth
    });

    },
    renderFilters : function() {
    var me = this;
    Ext.each(me.columns, function(column, index) {
    if(column.filter === false) return;
    var filter;
    if(Ext.isObject(column.filter))
    filter = column.filter;
    else
    filter = {};
    var config = {
    value: filter.value
    };
    if (column.xtype == 'xdatecolumn') {
    config.xtype = 'changedatefield';
    config.format = column.format;
    if(column.dataType == 'time'){
    config.datextype = 'xtimefield';
    config.validator = me.timeValidator;
    }
    if (column.dataType == 'date') {
    config.datextype = 'Ext.picker.Date';
    config.validator = me.dateValidator;
    } else {
    config.datextype = 'Ext.ux.DateTimePicker';
    config.validator = me.dateTimeValidator;
    }
    } else if (column.xtype == 'booleancolumn') {
    config.xtype = 'combo';
    config.store = Ext.create('Ext.data.Store', me.booleanSotre);
    config.displayField = 'name';
    config.valueField = 'value';
    config.forceSelection = true;
    } else if (column.xtype == 'numbercolumn') {
    if (column.dataType == 'int')
    config.validator = me.intNumberValidator;
    else if (column.dataType == 'byte')
    config.validator = me.byteNumberValidator;
    else if (column.dataType == 'short')
    config.validator = me.shortNumberValidator;
    else if (column.dataType == 'long')
    config.validator = me.longNumberValidator;
    }
    var filterContainerConfig = {
    itemId : column.id + '-filtersContainer',
    cls : this.filterContainerCls,
    layout : 'fit',
    border : false,
    width : column.width,
    listeners : {
    scope : this,
    element : 'el',
    mousedown : function(e) {e.stopPropagation();},
    click : function(e) {e.stopPropagation();},
    keydown : function(e) {e.stopPropagation();},
    keypress : function(e) {
    e.stopPropagation();
    if (e.getKey() == Ext.EventObject.ENTER) {
    var flag = true;
    Ext.Array.each(me.fields, function(field) {
    if (!field.isValid()) {
    flag = false;
    return false;
    }
    });
    if (flag === true)
    me.onFilterContainerEnter();
    }
    },
    keyup : function(e) {e.stopPropagation();}
    },
    items : []
    };
    var field = Ext.ComponentManager.create(Ext.apply({
    xtype : 'textfield',
    filterName : column.dataIndex,
    cls : this.filterFieldCls,
    itemId : column.id + '-filter',
    anchor : '-1'
    }, config));
    var filterContainer = Ext.create('Ext.container.Container', filterContainerConfig);
    filterContainer.items.add(field);

    filterContainer.render(column.el);//i think filter does not render in ie7|ie8|ie9
    me.fields.push(field);
    column.itemCon = filterContainer;
    me.containers[column.id] = filterContainer;
    column.setPadding = Ext.Function.createInterceptor(
    column.setPadding, function(h) {
    return false;
    });
    });
    },

    onFilterContainerEnter : function() {
    var me = this;
    var filters = [];
    me.grid.store.clearFilter(true);
    Ext.Array.each(me.fields, function(field) {
    if (field.getValue()) {
    var values = {};
    values['property'] = field.filterName;
    values['value'] = field.getValue();
    filters.push(values);
    me.grid.store.filters.add(values);
    }
    });
    this.grid.store.loadPage(1);
    },

    resizeFilterContainer : function(headerCt, column, w, opts) {
    if (!this.containers)
    return;
    var cnt = this.containers[column.id];
    if (cnt) {
    cnt.setWidth(w);
    cnt.doLayout();
    }
    },

    adjustFilterWidth : function() {
    if (!this.containers)
    return;
    var columns = this.columns;
    for ( var c = 0; c < columns.length; c++) {
    var column = columns[c];
    if (column.filter && column.flex) {
    this.containers[column.id].setWidth(column.getWidth() - 1);
    }
    }
    },
    byteNumberValidator : function(value) {
    if (value == null || value === "")
    return true;
    if (value == '--')
    return true;
    if (value == '!!')
    return true;
    var pos = value.indexOf(".");
    if (pos == -1) {
    var items = value.split(/\s*,\s*/);
    for ( var i = 0; i < items.length; i++) {
    var words = items[i].split(/\s*~\s*/);
    var count = 0;
    for ( var j = 0; j < words.length; j++) {
    var bln = Ext.isNumeric(words[j]);
    if (bln === true && words[j] <= 127 && words[j] >= -128) {
    count++;
    } else if (words[j] === "")
    continue;
    else {
    return Eap.errors.inputError;
    }
    }
    if (count < 1)
    return Eap.errors.inputError;
    }
    return true;
    } else
    return Eap.errors.inputError;
    },

    shortNumberValidator : function(value) {
    if (value == null || value === "")
    return true;
    if (value == '--')
    return true;
    if (value == '!!')
    return true;
    var pos = value.indexOf(".");
    if (pos == -1) {
    var items = value.split(/\s*,\s*/);
    for ( var i = 0; i < items.length; i++) {
    var words = items[i].split(/\s*~\s*/);
    var count = 0;
    for ( var j = 0; j < words.length; j++) {
    var bln = Ext.isNumeric(words[j]);
    if (bln === true && words[j] <= 32767 && words[j] >= -32768) {
    count++;
    } else if (words[j] === "")
    continue;
    else {
    return Eap.errors.inputError;
    }
    }
    if (count < 1)
    return Eap.errors.inputError;
    }
    return true;
    } else
    return Eap.errors.inputError;
    },
    intNumberValidator : function(value) {
    if (value == null || value === "")
    return true;
    if (value == '--')
    return true;
    if (value == '!!')
    return true;
    var pos = value.indexOf(".");
    if (pos == -1) {
    var items = value.split(/\s*,\s*/);
    for ( var i = 0; i < items.length; i++) {
    var words = items[i].split(/\s*~\s*/);
    var count = 0;
    for ( var j = 0; j < words.length; j++) {
    var bln = Ext.isNumeric(words[j]);
    if (bln === true && words[j] <= 2147483647&& words[j] >= -2147483648) {
    count++;
    } else if (words[j] === "")
    continue;
    else {
    return Eap.errors.inputError;
    }
    }
    if (count < 1)
    return Eap.errors.inputError;
    }
    return true;
    } else
    return Eap.errors.inputError;
    },
    longNumberValidator : function(value) {
    if (value == null || value === "")
    return true;
    if (value == '--')
    return true;
    if (value == '!!')
    return true;
    var pos = value.indexOf(".");
    if (pos == -1) {
    var items = value.split(/\s*,\s*/);
    for ( var i = 0; i < items.length; i++) {
    var words = items[i].split(/\s*~\s*/);
    var count = 0;
    for ( var j = 0; j < words.length; j++) {
    var bln = Ext.isNumeric(words[j]);
    if (bln === true && words[j] <= 9223372036854775807 && words[j] >= -9223372036854775808) {
    count++;
    } else if (words[j] === "")
    continue;
    else {
    return Eap.errors.inputError;
    }
    }
    if (count < 1)
    return Eap.errors.inputError;
    }
    return true;
    } else
    return Eap.errors.inputError;
    },

    dateValidator : function(value) {
    if (value == null || value === "")
    return true;
    if (value == '--')
    return true;
    if (value == '!!')
    return true;
    var items = value.split(/\s*,\s*/);
    for ( var i = 0; i < items.length; i++) {
    var words = items[i].split(/\s*~\s*/);
    var count = 0;
    for ( var j = 0; j < words.length; j++) {
    var bln = Ext.Date.parse(words[j], Eap.dateFormat);
    if (bln != null)
    count++;
    else if (words[j] === "")
    continue;
    else {
    return Eap.errors.inputError;
    }
    }
    if (count < 1)
    return Eap.errors.inputError;
    }
    return true;
    },

    timeValidator : function(value) {
    if (value == null || value === "")
    return true;
    if (value == '--')
    return true;
    if (value == '!!')
    return true;
    var items = value.split(/\s*,\s*/);
    for ( var i = 0; i < items.length; i++) {
    var words = items[i].split(/\s*~\s*/);
    var count = 0;
    for ( var j = 0; j < words.length; j++) {
    var bln = Ext.Date.parse(words[j], Eap.timeFormat);
    if (bln != null)
    count++;
    else if (words[j] === "")
    continue;
    else {
    return Eap.errors.inputError;
    }
    }
    if (count < 1)
    return Eap.errors.inputError;
    }
    return true;
    },
    dateTimeValidator : function(value) {
    if (value == null || value === "")
    return true;
    if (value == '--')
    return true;
    if (value == '!!')
    return true;
    var items = value.split(/\s*,\s*/);
    for ( var i = 0; i < items.length; i++) {
    var words = items[i].split(/\s*~\s*/);
    var count = 0;
    for ( var j = 0; j < words.length; j++) {
    var bln = Ext.Date.parse(words[j], Eap.datetimeFormat);
    if (bln != null)
    count++;
    else if (Ext.Date.parse(words[j], Eap.dateFormat) != null)
    count++;
    else if (words[j] === "")
    continue;
    else {
    return Eap.errors.inputError;
    }
    }
    if (count < 1)
    return Eap.errors.inputError;
    }
    return true;
    }
    });
    /* vim:ts=4w=4:et:ai
    */

  7. #67
    Sencha User
    Join Date
    Jul 2013
    Posts
    3
    Vote Rating
    0
    ng_varun is on a distinguished road

      0  

    Default Usage of Ext.ux.grid.plugin.HeaderFilters - local filtering option

    Usage of Ext.ux.grid.plugin.HeaderFilters - local filtering option


    Please share usage of Ext.ux.grid.plugin.HeaderFilters for local filtering option.

  8. #68
    Ext JS Premium Member mcouillard's Avatar
    Join Date
    Jun 2008
    Location
    Bucks County, PA
    Posts
    103
    Vote Rating
    8
    mcouillard will become famous soon enough

      0  

    Default


    So far so good using ExtJS 4.2.2 nightly, but I had to force the padding on x-column-header-inner to avoid Ext's auto-padding of top/bottom to valign center the text. Else the column filter would get pushed down out of view because of the padding.

    .x-group-sub-header .x-column-header-inner {
    padding: 3px 6px 5px !important;
    }

    I tried to make Ext aware of the new content we pushed into the column header, but couldn't seem to make it work. Ext just padded the text regardless of the container we added to it.

    I also tried to change the container hoping Ext would then see the column filter; no dice.

  9. #69
    Banned
    Join Date
    Oct 2013
    Posts
    34
    Vote Rating
    1
    shankar8rajah1 is on a distinguished road

      0  

    Default


    getting error when I tried adding the plugin:

    TypeError: k.push is not a function

    Am I doing something wrong here?

    Code:
    var grid = Ext.create('Ext.grid.Panel', {        border: false,
            region: 'center',
            //indexes:['name','service_group','azul_version', 'host_tech','ait_num','app_name','data_center','filer_mounts','instnaces','env'],
            store: store,
            columns: createHeaders(10),
            loadMask: true,
            features: [filters,searching],
            width: 400,
            layout: 'fit',
            tbar: Ext.create('Ext.Toolbar'),
            bbar: Ext.create('Ext.Toolbar'),
            plugins: [Ext.create('Ext.ux.grid.plugin.HeaderFilters')],
            enableTextSelection : true,
            selModel: {
                selType: 'cellmodel'
            }
        });

  10. #70
    Sencha User
    Join Date
    Dec 2007
    Posts
    8
    Vote Rating
    0
    aerozep is on a distinguished road

      0  

    Default


    same error....
    TypeError: result.push is not a function

    result.push(item);

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi