PDA

View Full Version : Adding static value to store



Jona
9 May 2011, 11:10 PM
Hi guys,

for a grid and a combobox I use the same store on one page. The thing is, that someone adds a value, the value is shown in the grid and in the next step the user is able to select the added value from a combobox to go on with his work.

Now I'd like to give the user the possibility to select a None value from the combobox that has ID -1. But this value should only be seen in the combobox but not in the grid.

Is there a possibility to handle this via filter? E.g. filter the DirectStore for the grid where VALUE != NONE and clearFilter afterwards so that every value, also the NONE value is loaded for the combobox? I tried this but it didn't work and I watched out for examples but didn't find what I needed. Perhaps you have one or can show me how to do this?

[EDIT]
How I call the store for the Grid looks like this:



xtype: 'grid',
...
store: Ext.getCmp('StoreClass').myTestStore,
columns: [
...
]


It's nearly the same way I call the store for my combobox



xtype: 'combo',
...
store: Ext.getCmp('StoreClass').myTestStore


Now I don't know how to add a filter and a clearFilter.

Thanks and best wishes,

Jona

friend
10 May 2011, 4:34 AM
Applying a filter to the store will affect all components which reference the store; there's no way around that.

Consider using a separate store for the Combo and the grid.

Jona
10 May 2011, 4:37 AM
Hi (my) friend,

thanks for your fast response. I think there's really no way out, what a pitty.

Nevertheless, thanks a lot and best wishes,

Jona