0
我有一个ComboBox供用户选择链接到DirectStore的表。 DirectStore包含一个directFn,它指向一个可以获取所有表的C#函数。这看起来像这样:将“无”项添加到DirectStore中
Ext.define('MyApp.store.DataSourceTable', {
extend: 'Ext.data.DirectStore',
constructor: function (cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
autoLoad: true,
storeId: 'DataSourceTable',
buffered: true,
purgePageCount: false,
directFn: NameSpace.API.DataSourceTables,
fields: [ 'Name', 'Id' ],
root: 'items',
totalProperty: 'total'
}, cfg)]);
}
});
这工作很好,但我希望用户有选择'没有表'的选项。在改变服务器上的函数以将任何元素作为元素返回之后,我该如何实现?
是否有一个事件,我可以挂钩到directFn返回数据后,哪里可以添加我的'无表'元素?
或者还有比这更好的方法吗?
谢谢! – Hannesh 2014-11-24 20:56:03