DeLe
DeLe

Reputation: 2480

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

Upvotes: 6

Views: 6373

Answers (1)

Juan Daniel Flores
Juan Daniel Flores

Reputation: 277

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);
}],

Upvotes: 6

Related Questions