View Full Version : How initialize GridFilter with Grid

5 Jan 2012, 3:39 AM

I've a table displaying some data using a Grid. I've several text columns and a date column.
When the table is displayed for the first time I need to limit the displayed results to the current date.

So I want to initialize the date filter with the date of the day, but I cannot find how to do this.
Does any one know how to initialise Filters during Grid creation ?

Thanks for reading

5 Jan 2012, 4:23 AM
You can add a StoreFilter to the Store.

5 Jan 2012, 6:36 AM
Thank you for you fast answer, but I still miss some info.

1th of all I forget to say that I'm using Ext GWT 2.2.4.
Then I'm not sure to understand but It seems to me that adding a store filter may have an impact on returned results but not a graphical impact.
Does my table will display that a filter is active ?
If I browse my date filter column on the table does the Filter check box will be selected ?

This is very important for me to initialize the table as if someone had clicked so the user can understand why the data is filered on the current date.

Finally I've tryed to add a StoreFilter to my ListStore to understand when this Filter is called but I never see any log.

store.addFilter(new StoreFilter<GxtFinishedCall>() {

public boolean select(Store<GxtFinishedCall> store, GxtFinishedCall parent, GxtFinishedCall item, String property) {
logger.logError("store " + store);
logger.logError("parent " + parent);
logger.logError("item " + item);
logger.logError("property " + property);
return false;

5 Jan 2012, 7:05 AM
Take a look at the DateFilter setValue code. There you can see what it expects and how to set a value. I do not know why it was implemented like this.

5 Jan 2012, 8:43 AM
Thanks a lot you saved us !

We finally did this :

On our existing dateFilter we've added a Filter Config as you suggested us.

DateFilter dateFilter = new DateFilter("date");
FilterConfig defaultFilterDateConfig = new FilterConfig() {
public Object getValue() {
return new Date();
public String getComparison() {
return "on";

List<FilterConfig> filtersDate = new ArrayList<FilterConfig>();

May be this could help someone.