PDA

View Full Version : Grid filters titles



gezb
29 Jan 2014, 4:38 AM
Hello. I want to change the text in the grid filter drop down menu to translate into different languages. I can change the menuFilterText as below. How do I change the beforeText, afterText and onText when the filter is applied to a date column ??

features: [
Ext.create('Ext.ux.grid.FiltersFeature', {
local: true,
menuFilterText: 'my new title', // this works fine
beforeText: 'new before text' // this does not work
})
],

scottmartin
29 Jan 2014, 5:49 AM
Does it work when you setup the filter in the grid itself, as shown in the API?
http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.ux.grid.filter.DateFilter-cfg-beforeText

gezb
29 Jan 2014, 6:20 AM
Thanks for replying. It is within the grid. Complete code is below

Ext.define('Contact.view.superAdmin.Accounts', {
extend: 'Ext.grid.Panel',
alias: 'widget.contact_account',

store: 'superAdmin.Accounts',

columnLines: true,
viewConfig: {
stripeRows: true
},

plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1,
pluginId: 'accountsplugin'
})
],


features: [
Ext.create('Ext.ux.grid.FiltersFeature', {
local: true,
active: true,
menuFilterText: 'my new title', // this works fine
beforeText: 'new before text' // this does not work
})
],

columns: [
{
text: 'Account Name',
flex: 1,
dataIndex: 'account_name',
editor: {
allowBlank: false,
maxLength: 20
},
filter: {
type: 'string'
}
},
{
text: 'Expire Date',
width: 200,
dataIndex: 'account_expires',
editor: {
allowBlank: true
},
filter: {
type: 'date'
}
}
]
});

scottmartin
29 Jan 2014, 6:29 AM
Right .. you have it in the UX to create the filter, not on the date filter itself down in the column.

gezb
29 Jan 2014, 6:34 AM
Thanks for your help. Working now. I changed the code as you advised

{
text: 'Expire Date',
width: 200,
dataIndex: 'account_expires',
editor: {
allowBlank: true
},
filter: {
type: 'date',
beforeText: 'new before text' // Now it does
}
}