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;
                                }        
                          }
                     }
        });
  • 相关阅读:
    一道题串联lambda表达式、链式编程、函数式接口、Stream流式计算
    JUC-8锁问题
    JUC-Java中的生产者消费者问题
    Jenkins配置
    kubernetes的配置
    容器技术之Docker的网站搭建
    CentOS 使用yum安装ELK环境命令详解
    golang学习笔记——context库
    golang学习笔记——sync库
    golang学习笔记——select
  • 原文地址:https://www.cnblogs.com/mingforyou/p/3364287.html
Copyright © 2011-2022 走看看