viewModel 数据绑定

formulas 中的数据a,即便没有用于绑定,初始化也也会执行get函数,debugger生效
viewModel: {
    data: {allowEdit: true},
    formulas: {
        a:{
          get:function(){
              debugger
-------------------------------------------------------------------------

var rec = new XS.model.User({ id: 12, name: 'Foo' }); var viewModel = new Ext.app.ViewModel({ links: { theUser: { type: 'xsT_comeg8989o', id: 17 } }, data: { otherUser: rec } }); viewModel.bind('{otherUser.name}', function(v) { console.log(v+'afasfasfasfafafasdf'); }); viewModel.set('otherUser.name',999)

 

posted on 2018-08-31 11:44  xsSystem  阅读(316)  评论(0编辑  收藏  举报