亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

extjs函數調用方法?

extjs函數調用方法?

慕蓋茨4494581 2019-02-05 10:06:06
init: function() {this.control({'userlist textfield[id=searchId]':{keyup:function(textfield, e){if (e.getKey() == 13) {this.searchUserByEnter //此處該如何調用searchUserByEnter 所標記的方法}}}}searchUserByEnter:function(textfield){alert('call search function')var grid = textfield.ownerCt.ownerCt,store =grid.getStore(),tbar=textfield.ownerCt,searchInfo= tbar.down('textfield').getValue();store.on('beforeload', function (store, options) {var param = {param:searchInfo};Ext.apply(store.proxy.extraParams, param);});var pagebar = grid.down('pagingtoolbar');pagebar.movePrevious();grid.getStore().load({params:{ start:0, limit:5}});}
查看完整描述

2 回答

?
眼眸繁星

TA貢獻1873條經驗 獲得超9個贊

當前this所引用的作用域已經改變了,可簡單修改為
init: function() {
var me = this;//保存作用域
this.control({
'userlist textfield[id=searchId]':{
keyup:function(textfield, e){

if (e.getKey() == 13) {
me .searchUserByEnter(textfield); //調用原作用域方法
}
}
}
}
規范點可參照extjs寫成scope參數控制this



查看完整回答
反對 回復 2019-03-14
  • 2 回答
  • 0 關注
  • 979 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號