【发布时间】:2014-12-19 08:13:48
【问题描述】:
在 Col1 列的“MyGrid”中,我将来自存储 True 或 False 的值更改为 Yes(对于 True)和 No(对于 false)。如果我没有在过滤器下指定任何选项,过滤器列表将显示为 True、False。我想用是(对于真)和否(对于假)进行本地过滤。我怎样才能做到这一点?
Ext.define('TestGrid', {
requires: [
'Ext.ux.grid.FiltersFeature'
],
extend: 'Ext.grid.Panel',
initComponent: function() {
var myStore = Ext.create('MyStore');
this.columns = [
{
text: 'Col1',
dataIndex: 'Col1',
sortable: true,
draggable: false,
renderer: function(value, metaData, record, rowIndex, colIndex, store) {
//changing from true/false to yes/no
if (value) {
return 'Yes';
} else {
return 'No;
}
}
}
];
this.features = [
{
ftype: 'filters',
local: true,
encode: false,
filters: [
{
type: 'list',
dataIndex: 'Col1',
options: ['Yes', 'No'],
phpMode: true
}
]
}
];
this.callParent(arguments);
}
});
【问题讨论】: