【发布时间】:2014-03-04 17:17:30
【问题描述】:
假设我有这家商店:
var statsType = Ext.create('Ext.data.Store', {
fields: ['id', 'grayedOutComboItem', 'type', 'typeClass'],
data: [{
'id': '',
'grayedOutComboItem': 'x-combo-grayed-out-item',
'type': '== Moyennes ==',
'typeClass': 'mean'
}, {
'id': '1',
'grayedOutComboItem': '',
'type': 'Moyennes journalières',
'typeClass': 'mean',
}, [...]
还有一个带有这个监听器的组合框:
[...]
listeners:
{
'beforeselect': function(combo, record, index)
{
return ("" != record.data.id);
}, [...]
它之所以有效,是因为如果单击具有空 id 的项目,组合框显示中不会发生任何事情。
但问题在于,它仍然会触发侦听器的事件。
所以当你点击它时仍然可以触发东西。
如何禁用它,使其不再触发任何东西!
:)
【问题讨论】:
标签: javascript extjs combobox