0
我有一个属性网格...ExtJS的网格属性更改侦听器不工作
Ext.create('Ext.grid.property.Grid', {
id : "PROPERTIES",
autoHeight: true,
width: 300,
viewConfig : {
forceFit: true,
scrollOffset: 2 // the grid will never have scrollbars
},
listeners :{
propertychange:function(source,recordId,value,oldValue){
alert(Ext.encode(source));
alert(recordId);
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"
}
});
我的查询
当在“源”改变的任何值,我需要一个听众抓变化。 假设用户尝试将“我的对象”中的“标题”更改为“标题1”。我怎样才能抓住新的“标题”。
注:在这个网格中,我给了一个听众“propertychange”。但没有效果!
请帮我解决这个问题。 谢谢
哪个版本你使用的是Ext JS吗?使用Ext JS 4.2.1,您的代码可以按照您的要求运行,当您更改任何属性时,会触发'propertychange'事件:https://fiddle.sencha.com/#fiddle/3ct – Akatum
'Ext.create('Ext.button。 。按钮”,{ 处理:函数(){ Ext.getCmp( “属性”)的SetSource({ “称号”: “Tikgh” });} , 文字: “更改源”, renderTo: Ext.getBody() });'请检查此... –