zoukankan      html  css  js  c++  java
  • Extjs CheckboxSelectionModel 置为无效 选择触发事件

    var smQd = new Ext.grid.CheckboxSelectionModel({
            renderer:function(value, metaData, record, rowIndex, colIndex, store){
                            if((record.data['xgdjzt'].split("-")[0] == 2)||(record.data['khlxzt'].split("-")[0] == 2)){
                                 return "";
                            }else{
                                return '<div class="x-grid3-row-checker"> </div>';
                            }
                       },
               //不允许使用点击表格形式修改选择
               handleMouseDown:Ext.emptyFn,
            listeners:{
                          /*'rowselect':function(sm,rowIndex,record){
                            console.log('rowselect',rowIndex)
                          },
                          'rowdeselect':function(sm,rowIndex,record){
                            console.log('rowdeselect',rowIndex)
                          },*/
                          'selectionchange':function(sm){
                              if(sm.getSelections().length>0){
                                  var select_zyed = 0;
                                  for(var i=0;i<sm.getSelections().length;i++){
                                      if((sm.getSelections()[i].data['xgdjzt'].split("-")[0] != 2)&&(sm.getSelections()[i].data['khlxzt'].split("-")[0] != 2)){
                                          var jyje_arr = sm.getSelections()[i].data['jyje'].split(",");
                                        var jyje_sel = "";
                                        for(var j = 0; j< jyje_arr.length; j++){
                                            jyje_sel += jyje_arr[j];
                                        }
                                          select_zyed = select_zyed + parseFloat(jyje_sel) ;
                                      }
                                  }
                                  used_ed.setValue(rendererZhMoney(select_zyed));
                                  //var total_ed_arr = total_ed.getValue().split(",");
                                  var total_ed_arr = Ext.getCmp("total_ed").getValue().split(",");
                                var total_ed = "";
                                for(var j = 0; j< total_ed_arr.length; j++){
                                    total_ed += total_ed_arr[j];
                                }
                                total_ed = parseFloat(total_ed);
                                leave_ed.setValue(rendererZhMoney(total_ed-select_zyed));
                              }else{
                                used_ed.setValue(rendererZhMoney(0));
                                //leave_ed.setValue(total_ed.getValue());
                                leave_ed.setValue(Ext.getCmp("total_ed").getValue());
                              }
                            
                          },
                           'beforerowselect':function(sm,rowIndex,keepExisting,record){
                                if((record.data['xgdjzt'].split("-")[0] == 2)||(record.data['khlxzt'].split("-")[0] == 2)){
                                    return false;
                                }else{
                                    return true;
                                }        
                          }
                     }
        });
  • 相关阅读:
    【convertio.co】免费在线文档转化神器
    成长需熬过“四苦”
    岁月饶过谁
    致我的未来
    一定要相信自己
    奋斗的意义是什么?
    一生一世一双人,半醉半醒半浮生
    逆境中的自己
    怎样才能让人看到你呢
    2020 遇见更好的自己
  • 原文地址:https://www.cnblogs.com/mingforyou/p/3364287.html
Copyright © 2011-2022 走看看