• 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();
                      }   
     
    })

  • 相关阅读:
    博客转移到cnblogs
    mmsplayer for ios 支持iphone ,ipad,ipod touch 版本已经完成。
    mmsplayer for ios v1.0
    无ldf文件情况下恢复数据库数据纪实
    我的Blog页面设计
    使用C#生成静态页面
    C++开发工具
    使用JNDI来读取Notes通讯录中的数据
    关于Char与string
    JavaScript站点荟萃
  • 原文地址:https://www.cnblogs.com/winner/p/1301075.html
Copyright © 2020-2023  润新知