所以我目前正在从事一个涉及创建大量带有模板列的网格的项目,我想知道是否可以将过滤应用于模板列?
注意我意识到我的解释有点含糊。
到目前为止我所做的:我的网格:
Ext.define('uber.view.grid.OpenRequestsGrid',{
extend:'Ext.grid.Panel',
xtype: 'openRequests',
layout: 'fit',
store: 'currentRequests',
emptyText: "<h3>You currently don't have any open requests</h3>",
initComponent: function () {
var me = this;
me.store = Ext.create('uber.store.grid.CurrentRequests');
me.store.load();
this.columns = [{
xtype: 'templatecolumn',
align: 'left',
flex: 1,
tpl: [
"<div class=''>" +
"<div class=''>" +
"<div class='title-section' style='display: inline; margin-left: 10px;'><b>Title:</b> {title}</div>" +
"<div class='subject-section' style='display: inline; margin-left: 10px;'><b>Subject:</b> {subject}</div>" +
"<div class='status-section' style='display: inline; margin-left: 10px;'><b>Status:</b> {status}</div>" +
"</div>" +
"<hr>" +
"<div class=''>" +
"<div class='description-label'><b>Description:</b></div>" +
"<div class='description-section'>{subjectDescription}</div>" +
"</div>" +
"</div>",
]
},{
xtype: 'actioncolumn',
width: 50,
align: 'center',
items:[{
xtype: 'button',
iconCls: 'x-fa fa-ellipsis-h',
tooltip: 'Details',
handler: function (grid, td, cellIndex, record, tr, rowIndex, e, eOpts) {
Ext.create('uber.view.session.SessionInfoWindow',{requestId: rowIndex.data.requestId}).show();
}
}]
}];
this.dockedItems = [{
xtype: 'toolbar',
items: [{
// The combobox here is supposed to be what sets the filter (by subject)
xtype: 'combobox',
fieldLabel: 'Subject',
}]
},{
xtype: 'pagingtoolbar',
displayInfo: true,
dock: 'bottom',
store: me.store
}];
this.callParent(arguments);
}
});
我的店铺:
Ext.define('uber.store.grid.OpenRequests',{
extend: 'Ext.data.Store',
alias: 'store.openRequests',
autoLoad: true,
proxy: {
type: 'ajax',
url: '/UberTutor/main/main-page!displayCurrentTutorRequests.action',
reader: {
type: 'json',
rootProperty: 'data',
totalProperty: 'total'
}
}
});
使用停靠在网格顶部的工具栏中的组合框,我想使用组合框中的值对网格的服务器数据应用过滤器。
所以我的问题是是否可以在这种网格上使用网格过滤,我将如何做这样的事情?