acc-win-override.js
上传用户:snow1005
上传日期:2015-11-10
资源大小:3151k
文件大小:6k
源码类别:

Ajax

开发平台:

JavaScript

  1. /* Override the module code here.
  2.  * This code will be Loaded on Demand.
  3.  */
  4. Ext.override(QoDesk.AccordionWindow, {
  5.     createWindow : function(){
  6.      var desktop = this.app.getDesktop();
  7.         var win = desktop.getWindow('acc-win');
  8.         if(!win){
  9.             win = desktop.createWindow({
  10.                 id: 'acc-win',
  11.                 title: 'Accordion Window',
  12.                 width:250,
  13.                 height:400,
  14.                 iconCls: 'acc-icon',
  15.                 shim:false,
  16.                 animCollapse:false,
  17.                 constrainHeader:true,
  18.                 maximizable: false,
  19.                 taskbuttonTooltip: '<b>Accordion Window</b><br />A window with an accordion layout',
  20.                 tbar:[{
  21.                     tooltip:'<b>Rich Tooltips</b><br />Let your users know what they can do!',
  22.                     iconCls:'demo-acc-connect'
  23.                 },'-',{
  24.                     tooltip:'Add a new user',
  25.                     iconCls:'demo-acc-user-add'
  26.                 },' ',{
  27.                     tooltip:'Remove the selected user',
  28.                     iconCls:'demo-acc-user-delete'
  29.                 }],
  30.                 layout: 'accordion',
  31.                 layoutConfig: {
  32.                     animate:false
  33.                 },
  34.                 items: [
  35.                     new Ext.tree.TreePanel({
  36.                         id:'im-tree',
  37.                         title: 'Online Users',
  38.                         loader: new Ext.tree.TreeLoader(),
  39.                         rootVisible:false,
  40.                         lines:false,
  41.                         autoScroll:true,
  42.                         useArrows: true,
  43.                         tools:[{
  44.                             id:'refresh',
  45.                             on:{
  46.                                 click: function(){
  47.                                     var tree = Ext.getCmp('im-tree');
  48.                                     tree.body.mask('Loading', 'x-mask-loading');
  49.                                     tree.root.reload();
  50.                                     tree.root.collapse(true, false);
  51.                                     setTimeout(function(){ // mimic a server call
  52.                                         tree.body.unmask();
  53.                                         tree.root.expand(true, true);
  54.                                     }, 1000);
  55.                                 }
  56.                             }
  57.                         }],
  58.                         root: new Ext.tree.AsyncTreeNode({
  59.                             text:'Online',
  60.                             children:[{
  61.                                 text:'Friends',
  62.                                 expanded:true,
  63.                                 children:[{
  64.                                     text:'Jack',
  65.                                     iconCls:'user',
  66.                                     leaf:true
  67.                                 },{
  68.                                     text:'Brian',
  69.                                     iconCls:'user',
  70.                                     leaf:true
  71.                                 },{
  72.                                     text:'Jon',
  73.                                     iconCls:'user',
  74.                                     leaf:true
  75.                                 },{
  76.                                     text:'Tim',
  77.                                     iconCls:'user',
  78.                                     leaf:true
  79.                                 },{
  80.                                     text:'Nige',
  81.                                     iconCls:'user',
  82.                                     leaf:true
  83.                                 },{
  84.                                     text:'Fred',
  85.                                     iconCls:'user',
  86.                                     leaf:true
  87.                                 },{
  88.                                     text:'Bob',
  89.                                     iconCls:'user',
  90.                                     leaf:true
  91.                                 }]
  92.                             },{
  93.                                 text:'Family',
  94.                                 expanded:true,
  95.                                 children:[{
  96.                                     text:'Kelly',
  97.                                     iconCls:'user-girl',
  98.                                     leaf:true
  99.                                 },{
  100.                                     text:'Sara',
  101.                                     iconCls:'user-girl',
  102.                                     leaf:true
  103.                                 },{
  104.                                     text:'Zack',
  105.                                     iconCls:'user-kid',
  106.                                     leaf:true
  107.                                 },{
  108.                                     text:'John',
  109.                                     iconCls:'user-kid',
  110.                                     leaf:true
  111.                                 }]
  112.                             }]
  113.                         })
  114.                     }), {
  115.                         title: 'Settings',
  116.                         html:'<p>Something useful would be in here.</p>',
  117.                         autoScroll:true
  118.                     },{
  119.                         title: 'Even More Stuff',
  120.                         html : '<p>Something useful would be in here.</p>'
  121.                     },{
  122.                         title: 'My Stuff',
  123.                         html : '<p>Something useful would be in here.</p>'
  124.                     }
  125.                 ]
  126.             });
  127.         }
  128.         win.show();
  129.     }
  130. });