我有一个名为资源的模型我需要监听更改事件我已附加绑定如下
var resModel = this.getModel("resources");
var resBinding = new Binding(resModel, "resources>/resources", resModel.getContext("/resources"));
resBinding.attachChange(this._resourceChanged.bind(this));
当我将数据添加到模型如下时,不会触发更改事件
var resources = this.getModel("resources").getProperty("/resources");
resources.push({
"res_num": 18,
"name": "New Added"
});
this.getModel("resources").setProperty("/resources", resources);
但是当我第一次将数据添加到模型时,它会触发
this.resourceModel.setData({
'resources': resources
});