• Ext.extend()的运用


     
     FormSet_Tabpage_SimpleSelGrid= Ext.extend(Ext.grid.GridPanel,{
                selwindow:null,
                constructor:function(obj){
                         //  if (this.selwindow ==null ) selwindow= new FormSet_Tabpage_SimpleSelGridWindow( obj );         
                         FormSet_Tabpage_SimpleSelGrid.superclass.constructor.call(this,{
                                                                            plain:true,
                                                                            basecls:'x-plain',
                                                                            bodyStyle : 'padding:6px', 
                                                                            store: obj.gridstore,  //动态store
                                                                            cm: obj.gridcm,   //动态cm
                                                                            autoHeight :true,
                                                                            autoWidth:true, 
                                                                            trackMouseOver:false,
                                                                            viewConfig: {forceFit: true  }, 
                                                                            loadMask: true, 
                                                                            autoScroll:true ,
                                                                            windowLock:false,
                                                                            listeners:{  
                                                                                         celldblclick:function(){alert(99); this.rowdblclick }
                                                                      }, 
                                                                            bbar: new Ext.PagingToolbar({
                                                                           pageSize: obj.gridpageSize,  //动态每页显示数
                                                                           store:  obj.gridstore,       //动态store
                                                                           displayInfo: true,
                                                                           displayMsg: '第{0}-{1}条记录 共{2}',
                                                                           emptyMsg: "没有记录信息"
                                                                           }),
                                                                            sm: new Ext.grid.RowSelectionModel({
                                                                                        singleSelect:true
                                                                                 })                    
                                                                    });
                                                                   
                     },
            rowdblclick:function(){
                    alert(88);
            }           
        }) ;
     
     FormSet_Tabpage_SimpleSelGridWindow=Ext.extend(Ext.Window,{
      selgrid: null, //new FormSet_Tabpage_SimpleSelGrid(obj),
      constructor:function( obj ){
                          this.selgrid = new FormSet_Tabpage_SimpleSelGrid(obj);
                 FormSet_Tabpage_SimpleSelGridWindow.superclass.constructor.call(this,{
                                                     plain:true,
                                                     title:"选择窗口",
                                                     closeAction :'hide',
                                                     autoScroll:true ,
                                                     300,
                                                     modal:true,
                                                     height:400,
                                                     items:  this.selgrid ,
                                                     buttons:[ {
                                                                 text:'确定',
                                                                 handler:this.onSubmitclick ,
                                                                 scope:this },
                                                                {
                                                                 text:'取消',
                                                                 handler:this.onCancelclick,
                                                                 scope:this
                                                                }
                                                             ]
                                                             }) ;
              this.addEvents("submit"); //构造函数中添加事件                                           
                    }, //end function 
      close:function(){
                     this.hide();
                   },
         onSubmitclick:function(){
                       var gridrec= this.selgrid.getSelectionModel().getSelected() ;
                       this.fireEvent("submit",this, gridrec ) ; //添加事件
                       //alert( Ext.encode( gridrec.data ) )
                       this.close();
                      } ,
         onCancelclick:function(){
                        alert(999);
                        this.close();
                      }   
     
    })

  • 相关阅读:
    ubuntu安装mysql并使用Navicat连接
    二叉树基础知识点
    Javascript 16进制转有符号的10进制整数
    Node.js 学习笔记(二)
    API测试如何演变为应用程序开发的常规部分
    API在线文档
    API文档自动生成的方法
    快速对比API版本
    如何使用OPENAPI进行质量检查
    【分享】什么是API网关?大公司为什么都有API网关?
  • 原文地址:https://www.cnblogs.com/winner/p/1301075.html
Copyright © 2020-2023  润新知