打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
EditorGridPanel 增加、删除空白行
红色为关键代码   

varinsur_typesSM = new Ext.grid.CheckboxSelectionModel({singleSelect:false});
    
    varMyRecord =Ext.data.Record.create([  
             {name:'id',type:'Number'},  
             {name:'name',type:'String'},  
             {name:'name',type:'String'}  
         ]);  
     vareditorGridStore = newExt.data.JsonStore(  
                    
                      fields : [  
                           'id','name','desc' 
                       ]
                    
               );  
    varinsur_typesCM = new Ext.grid.ColumnModel([
     insur_typesSM,
     {header:'津贴种类',dataIndex:'medType',sortable:true,width:80,id:'expand',align:'center'},
     {header:'金额',dataIndex:'employeeName',sortable:true,width:80,align:'center'},
     {header:'备注',dataIndex:'idNumber',sortable:true,align:'center',menuDisabled:true}
    ]);
    
    vareditorGrid = new Ext.grid.EditorGridPanel({
     id:'editorGrid',
     title:"津贴明细",
     height:252,
     width:669,
     store:editorGridStore,
          cm: insur_typesCM,
          sm: insur_typesSM,
          autoExpandColumn:'expand',clicksToEdit:1,
          columnLines: true,
          loadMask: {msg:'正在加载数据,请稍侯……'},
     tbar:[{
           text:'增加',
           iconCls:'as_add',
           scale:'large',
           handler :function(){  
                           var newRow = newMyRecord(  
                                 
                                    id:'',  
                                    name:'',  
                                    desc:'' 
                                
                           );  
                           editorGrid.stopEditing();  
                           editorGridStore.insert(0,newRow),  
                           editorGrid.startEditing(0,0);  
                        
          },{
           text:'删除',
           scale: 'large',
           iconCls:'as_delete',
           handler: function(){
            if(insur_typesSM.getSelections().length< 1 ){
        Ext.example.msg('系统提示','请至少选择一条数据');
        return;
       }
 Ext.MessageBox.warningConfirm('确认操作','<spanstyle="font-size:16px;color:#ff0000">警告</span>:该操作将会删除选中的缴费险种及其相关信息,且操作无法恢复。<br/><br/>确定要继续吗?',function(v){
                if(v=='yes'){
                 
                 varrecs = editorGrid.getSelectionModel().getSelections();
                 if(recs){
                  for(vari=0; i<recs.length;i++){
                   
                   Ext.getCmp('editorGrid').getStore().remove(recs[i]);
                  }
                 }
         Ext.getCmp('editorGrid').getView().refresh();
                }
               },this);
              }
          }],
     listeners:{
      afterEdit:function(e){
       
      }
     }
    });
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Extjs学习总结之23EditGridPanel可编辑表格
Ext.grid.EditorGridPanel的使用、修改记录的获取及提交方法
grid中某一列显示图片链接,触发单击事件,弹出本页的另一个form
extjs的EditorGridPanel中的ComboBox列中显示值的问题
Ext.grid.ColumnModel
ExtJS5学习之Grid与Grid之间的数据拖拽
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服