Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Hide a item in combo - Extjs 4.1

I have a combobox like http://jsfiddle.net/8jnRR/

enter image description here
Here is my store

var stored = new Ext.data.SimpleStore({
      fields: [ "value", "text" ],
      data: [
        [ 0, "Online0" ],
        [ 1, "Online1" ],
        [ 2, "Online2" ]
        ,[ 100, "Hide" ] // how to hide this item
      ]
    });


I want to hide a item has value is 100 above. How to do that, thanks so much

like image 473
DeLe Avatar asked Jul 23 '13 05:07

DeLe


1 Answers

Take a look at this modified fiddle http://jsfiddle.net/jdflores/8jnRR/1/ It uses the store's filters config. I'm including a function that determines if the record.data.value is less than 100:

filters: [function(record, id){
    return (record.data.value < 100);
}],
like image 52
Juan Daniel Flores Avatar answered Sep 21 '22 14:09

Juan Daniel Flores