日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Extjs中给同一个GridPanel中的事件添加参数的方法

發布時間:2023/12/18 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Extjs中给同一个GridPanel中的事件添加参数的方法 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Extjs中給同一個GridPanel中的事件添加參數的方法:

this.isUse = new Ext.Action({
?? ??? ??? ?text:'啟用',
?? ??? ??? ?scope:this,
?? ??? ??? ?handler:this.isUseWin.createDelegate (this,[1])
?? ??? ?});
?? ??? ?this.isNotUse = new Ext.Action({
?? ??? ??? ?text:'停用',
?? ??? ??? ?scope:this,
?? ??? ??? ?handler:this.isUseWin.createDelegate (this,[0])
?});

?

接收的時候:

isUseWin:function(e){
?? ??? ?/** 選中的記錄 */
?? ??? ?var records = this.getSelectionModel().getSelections();
?? ??? ?/** 存放id的數組 */
?? ??? ?var array = [];
?? ??? ?if (records == null || records.length == 0) {
?? ??? ??? ?Ext.MessageBox.show({
?? ??? ??? ??? ??? ??? ?title : '警告',
?? ??? ??? ??? ??? ??? ?icon : Ext.MessageBox.WARNING,
?? ??? ??? ??? ??? ??? ?buttons : Ext.MessageBox.OK,
?? ??? ??? ??? ??? ??? ?msg : '請選擇一條的記錄'
?? ??? ??? ??? ??? ?});
?? ??? ??? ?return false;
?? ??? ?}
?? ??? ?// 遍歷記錄將id放入數組
?? ??? ?Ext.each(records, function(record) {
?? ??? ??? ?array.push(record.data.unitId);
?? ??? ?})
?? ??? ?Ext.MessageBox.confirm('提示','你確定要啟用選中的記錄嗎?',function(button){
?? ??? ??? ?if(button =='yes'){
?? ??? ??? ??? ?Ext.Ajax.request({
?? ??? ??? ??? ??? ?url:this.useUrl,
?? ??? ??? ??? ??? ?method:'POST',
?? ??? ??? ??? ??? ?params:{
?? ??? ??? ??? ??? ??? ?unitIds:array.join(','),
?? ??? ??? ??? ??? ??? ?isUsing:e
?? ??? ??? ??? ??? ?},
?? ??? ??? ??? ??? ?success:function(response,options){
?? ??? ??? ??? ??? ??? ?var text = Ext.decode(response.responseText);
?? ??? ??? ??? ??? ??? ?Ext.Msg.alert('提示',text.msg,function(){
?? ??? ??? ??? ??? ??? ??? ?this.store.reload();
?? ??? ??? ??? ??? ??? ?},this);
?? ??? ??? ??? ??? ?},
?? ??? ??? ??? ??? ?failure:function(){
?? ??? ??? ??? ??? ??? ?Ext.Msg.alert('提示','請求失敗!');
?? ??? ??? ??? ??? ?},
?? ??? ??? ??? ??? ?scope:this
?? ??? ??? ??? ?});
?? ??? ??? ?}
?? ??? ?},this)
}

轉載于:https://www.cnblogs.com/zrui-xyu/p/4615948.html

總結

以上是生活随笔為你收集整理的Extjs中给同一个GridPanel中的事件添加参数的方法的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。