我有这段代码,你可以在这里测试:
Ext.application({
name: 'Fiddle',
launch: function() {
Ext.create('Ext.grid.property.Grid', {
id: "PROPERTIES",
renderTo: Ext.getBody(),
autoHeight: true,
width: 300,
viewConfig: {
forceFit: true,
scrollOffset: 2 // the grid will never have scrollbars
},
listeners: {
propertychange: function(source, recordId, value, oldValue) {
alert("new Value=" + value);
}
},
source: {
"title": "My Object",
"color": Ext.Date.parse('10/15/2006', 'm/d/Y'),
"Available": false,
"Version": 0.01,
"Description": "A test object"
}
});
}
});
当我在示例中将 false 值更改为 true 时,属性更改事件仅在我单击 true/false 框时触发。我希望在更改值后立即触发事件(或另一个事件)。我怎样才能做到这一点?