作用域的问题,参考下方的修改
- spreadInitHandle: function (spread) {
- this.spread = spread
- this.initSpread()
- var self =this;
- this.spread.bind( GC.Spread.Sheets.Events.ActiveSheetChanged, function (e, args) {
- self.abc()
- self.btnStr = 'abc'
- console.log(args.newSheet.name())
- // switch (args.newSheet.name()) {
- // case 'Sheet1':
- // this.btnStr = '测试1'
- // break
- // case 'Sheet2':
- // this.btnStr = '测试2'
- // break
- // }
- })
- // this.spread.fromJSON(s)
- },
复制代码 |