PDA

View Full Version : Date Grid Filter



ociowaty
8 Jan 2013, 12:44 AM
Hello,
I have grid:

Ext.define('App.view.grids.Campaigns' ,{
extend: 'Ext.grid.Panel',
alias : 'widget.campaignsGrid',
disableSelection: true,
height: Ext.getBody().getViewSize().height-55,
store: store,
viewConfig: {
trackOver: false
},
features: [filters],
initComponent: function() {

this.columns = [
{ header: 'name', dataIndex: 'name', flex:1, filter : true},
{ header: 'status', dataIndex: 'status', flex:1, filter: { type: 'list',
store: statusStore
}},
{ header: 'startDate', dataIndex: 'startDate', flex:1, filter : true, renderer:Ext.util.Format.dateRenderer('m-d-Y H:i:s')},
{ header: 'endDate', dataIndex: 'endDate', flex:1, filter : true},
];

this.callParent(arguments);
}
});

Store, model:

Ext.define('Compaigns', {
extend: 'Ext.data.Model',
fields: [
{ name: 'name' },
{ name: 'status' },
{ name: 'startDate', type: 'date', dateFormat: 'Y-m-d H:i:s'},
{ name: 'endDate',type: 'date', dateFormat: 'Y-m-d H:i:s' },
]
});
var store = Ext.create('Ext.data.Store', {
model: 'Compaigns',
autoLoad: false,
autoSync: false,
autoDestroy: true,
pageSize: 20000,
buffered: true,


clearFilter : false,
idClient: 0,

proxy: {
type: 'ajax',
api: {
read: '/campaigns'
},
reader: {
type: 'json',
root: 'campaigns',
successProperty: 'success',
totalProperty : 'total'
}
}
});

I have problem with filtration by Dates. I'm using remote filtration from examples ( http://dev.sencha.com/deploy/ext-4.0.0/examples/grid-filtering/grid-filter-local.html )
Problem is when I want to filter data by date field. The request is sending but in POST/GET array there no filtration data.

Did someone have the same problem ?

mitchellsimoens
10 Jan 2013, 9:55 AM
What Ext JS 4.x.x version are you using?