1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    30
    Answers
    1
    Vote Rating
    0
    Envision123 is on a distinguished road

      0  

    Default Answered: How to make windows open 100%?

    Answered: How to make windows open 100%?


    How can you make windows in the sample desktop open 100% by default? For example, here is some of my sample code:

    Code:
    Ext.define("MyDesktop.ExtrasWindow",{extend:"Ext.ux.desktop.Module",requires:["Ext.tab.Panel"],id:"extras",init:function(){this.launcher={text:"Free Extras",iconCls:"tabs",handler:this.createWindow,scope:this}},createWindow:function(){var b=this.app.getDesktop();var a=b.getWindow("extras");if(!a){a=b.createWindow({id:"extras",title:"Free Extras",width:740,height:480,iconCls:"tabs",animCollapse:false,border:false,constrainHeader:true,layout:"fit",items:[{xtype:"tabpanel",activeTab:0,bodyStyle:"padding: 5px;",items:[{title:"Free Themes",header:false,html:'<iframe frameBorder="0" height="100%" width="100%" src="http://themes.site.com"></iframe>',border:false},{title:"Free Addons",header:false,html:'<iframe frameBorder="0" height="100%" width="100%" src="http://addons.site.com"></iframe>',border:false},{title:"Free Modules",header:false,html:'<iframe frameBorder="0" height="100%" width="100%" src="http://modules.site.com"></iframe>',border:false}]}]})}a.show();return a}});Ext.define("Ext.panel.Table",{extend:"Ext.panel.Panel",alias:"widget.tablepanel",uses:["Ext.selection.RowModel","Ext.grid.Scroller","Ext.grid.header.Container","Ext.grid.Lockable"],cls:Ext.baseCSSPrefix+"grid",extraBodyCls:Ext.baseCSSPrefix+"grid-body",layout:"fit",hasView:false,viewType:null,selType:"rowmodel",scrollDelta:40,scroll:true,sortableColumns:true,verticalScrollDock:"right",verticalScrollerType:"gridscroller",horizontalScrollerPresentCls:Ext.baseCSSPrefix+"horizontal-scroller-present",verticalScrollerPresentCls:Ext.baseCSSPrefix+"vertical-scroller-present",scrollerOwner:true,invalidateScrollerOnRefresh:true,enableColumnMove:true,enableColumnResize:true,initComponent:function(){var g=this,a=g.scroll,d=false,c=false,h=g.columns||g.colModel,f=0,b,e=g.border;g.determineScrollbars=Ext.Function.createBuffered(g.determineScrollbars,30);g.injectView=Ext.Function.createBuffered(g.injectView,30);if(g.hideHeaders){e=false}if(h instanceof Ext.grid.header.Container){g.headerCt=h;g.headerCt.border=e;g.columns=g.headerCt.items.items}else{if(Ext.isArray(h)){h={items:h,border:e}}Ext.apply(h,{forceFit:g.forceFit,sortable:g.sortableColumns,enableColumnMove:g.enableColumnMove,enableColumnResize:g.enableColumnResize,border:e});g.columns=h.items;if(Ext.ComponentQuery.query("{locked !== undefined}{processed != true}",g.columns).length){g.self.mixin("lockable",Ext.grid.Lockable);g.injectLockable()}}g.store=Ext.data.StoreManager.lookup(g.store);g.addEvents("scrollerhide","scrollershow");g.bodyCls=g.bodyCls||"";g.bodyCls+=(" "+g.extraBodyCls);delete g.autoScroll;if(!g.hasView){if(!g.headerCt){g.headerCt=Ext.create("Ext.grid.header.Container",h)}g.columns=g.headerCt.items.items;if(g.hideHeaders){g.headerCt.height=0;g.headerCt.border=false;g.headerCt.addCls(Ext.baseCSSPrefix+"grid-header-ct-hidden");g.addCls(Ext.baseCSSPrefix+"grid-header-hidden");if(Ext.isIEQuirks){g.headerCt.style={display:"none"}}}if(a===true||a==="both"){d=c=true}else{if(a==="horizontal"){c=true}else{if(a==="vertical"){d=true}else{g.headerCt.availableSpaceOffset=0}}}if(d){g.verticalScroller=g.verticalScroller||{};Ext.applyIf(g.verticalScroller,{dock:g.verticalScrollDock,xtype:g.verticalScrollerType,store:g.store});g.verticalScroller=Ext.ComponentManager.create(g.verticalScroller);g.mon(g.verticalScroller,{bodyscroll:g.onVerticalScroll,scope:g})}if(c){g.horizontalScroller=Ext.ComponentManager.create({xtype:"gridscroller",section:g,dock:"bottom",store:g.store});g.mon(g.horizontalScroller,{bodyscroll:g.onHorizontalScroll,scope:g})}g.headerCt.on("columnresize",g.onHeaderResize,g);g.relayEvents(g.headerCt,["columnresize","columnmove","columnhide","columnshow","sortchange"]);g.features=g.features||[];g.dockedItems=g.dockedItems||[];g.dockedItems.unshift(g.headerCt);g.viewConfig=g.viewConfig||{};g.viewConfig.invalidateScrollerOnRefresh=g.invalidateScrollerOnRefresh;b=g.getView();if(b){g.mon(b.store,{load:g.onStoreLoad,scope:g});g.mon(b,{refresh:{fn:this.onViewRefresh,scope:g,buffer:50},itemupdate:g.onViewItemUpdate,scope:g});this.relayEvents(b,["beforeitemmousedown","beforeitemmouseup","beforeitemmouseenter","beforeitemmouseleave","beforeitemclick","beforeitemdblclick","beforeitemcontextmenu","itemmousedown","itemmouseup","itemmouseenter","itemmouseleave","itemclick","itemdblclick","itemcontextmenu","beforecontainermousedown","beforecontainermouseup","beforecontainermouseover","beforecontainermouseout","beforecontainerclick","beforecontainerdblclick","beforecontainercontextmenu","containermouseup","containermouseover","containermouseout","containerclick","containerdblclick","containercontextmenu","selectionchange","beforeselect"])}}g.callParent(arguments)},initStateEvents:function(){var a=this.stateEvents;Ext.each(["columnresize","columnmove","columnhide","columnshow","sortchange"],function(b){if(Ext.Array.indexOf(a,b)){a.push(b)}});this.callParent()},getState:function(){var a={columns:[]},b=this.store.sorters.first();this.headerCt.items.each(function(c){a.columns.push({id:c.headerId,width:c.flex?undefined:c.width,hidden:c.hidden,sortable:c.sortable})});if(b){a.sort={property:b.property,direction:b.direction}}return a},applyState:function(a){var c=a.columns,b=c?c.length:0,d=this.headerCt,h=d.items,l=a.sort,j=this.store,e=0,g,k,f;for(;e<b;++e){k=c[e];f=d.down("gridcolumn[headerId="+k.id+"]");g=h.indexOf(f);if(e!==g){d.moveHeader(g,e)}f.sortable=k.sortable;if(Ext.isDefined(k.width)){delete f.flex;if(f.rendered){f.setWidth(k.width)}else{f.minWidth=f.width=k.width}}f.hidden=k.hidden}if(l){if(j.remoteSort){j.sorters.add(Ext.create("Ext.util.Sorter",{property:l.property,direction:l.direction}))}else{j.sort(l.property,l.direction)}}},getStore:function(){return this.store},getView:function(){var a=this,b;if(!a.view){b=a.getSelectionModel();a.view=a.createComponent(Ext.apply({},a.viewConfig,{xtype:a.viewType,store:a.store,headerCt:a.headerCt,selModel:b,features:a.features,panel:a}));a.mon(a.view,{uievent:a.processEvent,scope:a});b.view=a.view;a.headerCt.view=a.view;a.relayEvents(a.view,["cellclick","celldblclick"])}return a.view},setAutoScroll:Ext.emptyFn,elScroll:function(d,e,b){var c=this,a;if(d==="up"||d==="left"){e=-e}if(d==="down"||d==="up"){a=c.getVerticalScroller();a.scrollByDeltaY(e)}else{a=c.getHorizontalScroller();a.scrollByDeltaX(e)}},afterLayout:function(){this.callParent(arguments);this.injectView()},injectView:function(){if(!this.hasView&&!this.collapsed){var b=this,a=b.getView();b.hasView=true;b.add(a);a.el.scroll=Ext.Function.bind(b.elScroll,b);b.mon(a.el,{mousewheel:b.onMouseWheel,scope:b})}},afterExpand:function(){this.callParent(arguments);if(!this.hasView){this.injectView()}},processEvent:function(f,b,a,c,d,h){var g=this,i;if(d!==-1){i=g.headerCt.getGridColumns()[d];return i.processEvent.apply(i,arguments)}},determineScrollbars:function(){var e=this,b,a,f,d,c;if(!e.collapsed&&e.view&&e.view.el){b=e.view.el.dom;a=e.headerCt.getFullWidth();f=b.offsetWidth;if(e.verticalScroller&&e.verticalScroller.el){d=e.verticalScroller.getSizeCalculation().height}else{d=b.scrollHeight}c=b.clientHeight;if(!e.collapsed&&d>c){e.showVerticalScroller()}else{e.hideVerticalScroller()}if(!e.collapsed&&a>(f+Ext.getScrollBarWidth()-2)){e.showHorizontalScroller()}else{e.hideHorizontalScroller()}}},onHeaderResize:function(){if(this.view&&this.view.rendered){this.determineScrollbars();this.invalidateScroller()}},hideHorizontalScroller:function(){var a=this;if(a.horizontalScroller&&a.horizontalScroller.ownerCt===a){a.verticalScroller.offsets.bottom=0;a.removeDocked(a.horizontalScroller,false);a.removeCls(a.horizontalScrollerPresentCls);a.fireEvent("scrollerhide",a.horizontalScroller,"horizontal")}},showHorizontalScroller:function(){var a=this;if(a.verticalScroller){a.verticalScroller.offsets.bottom=Ext.getScrollBarWidth()-2}if(a.horizontalScroller&&a.horizontalScroller.ownerCt!==a){a.addDocked(a.horizontalScroller);a.addCls(a.horizontalScrollerPresentCls);a.fireEvent("scrollershow",a.horizontalScroller,"horizontal")}},hideVerticalScroller:function(){var a=this,b=a.headerCt;if(b&&b.layout.reserveOffset){b.layout.reserveOffset=false;b.doLayout()}if(a.verticalScroller&&a.verticalScroller.ownerCt===a){a.removeDocked(a.verticalScroller,false);a.removeCls(a.verticalScrollerPresentCls);a.fireEvent("scrollerhide",a.verticalScroller,"vertical")}},showVerticalScroller:function(){var a=this,b=a.headerCt;if(b&&!b.layout.reserveOffset){b.layout.reserveOffset=true;b.doLayout()}if(a.verticalScroller&&a.verticalScroller.ownerCt!==a){a.addDocked(a.verticalScroller);a.addCls(a.verticalScrollerPresentCls);a.fireEvent("scrollershow",a.verticalScroller,"vertical")}},invalidateScroller:function(){var b=this,a=b.verticalScroller,c=b.horizontalScroller;if(a){a.invalidate()}if(c){c.invalidate()}},onHeaderMove:function(c,d,a,b){this.view.refresh()},onHeaderHide:function(a,b){this.invalidateScroller()},onHeaderShow:function(a,b){this.invalidateScroller()},getVerticalScroller:function(){return this.getScrollerOwner().down("gridscroller[dock="+this.verticalScrollDock+"]")},getHorizontalScroller:function(){return this.getScrollerOwner().down("gridscroller[dock=bottom]")},onMouseWheel:function(j){var k=this,n=j.browserEvent,g=k.getVerticalScroller(),l=k.getHorizontalScroller(),c=k.scrollDelta,d,f,i,m,h,b,o,a;if(l){m=l.el;if(m){h=m.dom.scrollLeft}}if(g){i=g.el;if(i){b=i.dom.scrollTop}}if(n.wheelDeltaX||n.wheelDeltaY){f=-n.wheelDeltaX/120*c/3;d=-n.wheelDeltaY/120*c/3;if(l){o=l.scrollByDeltaX(f)}if(g){a=g.scrollByDeltaY(d)}}else{if(n.axis&&n.axis===1){if(l){f=-(c*j.getWheelDelta())/3;o=l.scrollByDeltaX(f)}}else{if(g){d=-(c*j.getWheelDelta()/3);a=g.scrollByDeltaY(d)}}}if((f!==0&&o!==h)||(d!==0&&a!==b)){j.stopEvent()}},onViewRefresh:function(){if(Ext.isIE){this.syncCellHeight()}this.determineScrollbars();if(this.invalidateScrollerOnRefresh){this.invalidateScroller()}},onViewItemUpdate:function(a,b,c){if(Ext.isIE){this.syncCellHeight([c])}},syncCellHeight:function(g){var m=this,f=0,e,d,h,l,c,n,k=[],a,b=("."+Ext.baseCSSPrefix+"grid-cell");g=g||m.view.getNodes();n=g.length;for(;f<n;f++){l=g[f];e=Ext.fly(l).query(b);h=e.length;a=[];for(d=0;d<h;d++){c=e[d];a.push(c.clientHeight)}k.push(Ext.Array.max(a))}for(f=0;f<n;f++){l=g[f];h=l.childNodes.length;for(d=0;d<h;d++){c=Ext.fly(l.childNodes[d]);if(k[f]){if(c.is(b)){c.setHeight(k[f])}else{c.down(b).setHeight(k[f])}}}}},setScrollTop:function(d){var c=this,b=c.getScrollerOwner(),a=c.getVerticalScroller();b.virtualScrollTop=d;if(a){a.setScrollTop(d)}},getScrollerOwner:function(){var a=this;if(!this.scrollerOwner){a=this.up("[scrollerOwner]")}return a},scrollByDeltaY:function(a){var c=this.getScrollerOwner(),b;b=c.down("gridscroller[dock="+this.verticalScrollDock+"]");if(b){b.scrollByDeltaY(a)}},scrollByDeltaX:function(a){this.horizontalScroller.scrollByDeltaX(a)},getLhsMarker:function(){var a=this;if(!a.lhsMarker){a.lhsMarker=Ext.core.DomHelper.append(a.el,{cls:Ext.baseCSSPrefix+"grid-resize-marker"},true)}return a.lhsMarker},getRhsMarker:function(){var a=this;if(!a.rhsMarker){a.rhsMarker=Ext.core.DomHelper.append(a.el,{cls:Ext.baseCSSPrefix+"grid-resize-marker"},true)}return a.rhsMarker},getSelectionModel:function(){if(!this.selModel){this.selModel={}}var b="SINGLE",a;if(this.simpleSelect){b="SIMPLE"}else{if(this.multiSelect){b="MULTI"}}Ext.applyIf(this.selModel,{allowDeselect:this.allowDeselect,mode:b});if(!this.selModel.events){a=this.selModel.selType||this.selType;this.selModel=Ext.create("selection."+a,this.selModel)}if(!this.selModel.hasRelaySetup){this.relayEvents(this.selModel,["selectionchange","select","deselect"]);this.selModel.hasRelaySetup=true}if(this.disableSelection){this.selModel.locked=true}return this.selModel},onVerticalScroll:function(e,f){var b=this.getScrollerOwner(),c=b.query("tableview"),d=0,a=c.length;for(;d<a;d++){c[d].el.dom.scrollTop=f.scrollTop}},onHorizontalScroll:function(b,j){var d=this.getScrollerOwner(),k=d.query("tableview"),f=0,h=k.length,a,e,g,l,c;a=k[1]||k[0];e=a.el.dom;g=e.scrollWidth;l=e.offsetWidth;c=this.horizontalScroller.getWidth();e.scrollLeft=j.scrollLeft;this.headerCt.el.dom.scrollLeft=j.scrollLeft},onStoreLoad:Ext.emptyFn,getEditorParent:function(){return this.body},bindStore:function(a){var b=this;b.store=a;b.getView().bindStore(a)},reconfigure:function(a,b){var c=this;if(c.lockable){c.reconfigureLockable(a,b);return}if(b){c.headerCt.removeAll();c.headerCt.add(b)}if(a){a=Ext.StoreManager.lookup(a);c.bindStore(a)}else{c.getView().refresh()}},afterComponentLayout:function(){this.callParent(arguments);this.determineScrollbars();this.invalidateScroller()}});Ext.define("Ext.grid.Panel",{extend:"Ext.panel.Table",requires:["Ext.grid.View"],alias:["widget.gridpanel","widget.grid"],alternateClassName:["Ext.list.ListView","Ext.ListView","Ext.grid.GridPanel"],viewType:"gridview",lockable:false,normalCfgCopy:["invalidateScrollerOnRefresh","verticalScroller","verticalScrollDock","verticalScrollerType","scroll"],lockedCfgCopy:["invalidateScrollerOnRefresh"],initComponent:function(){var a=this;if(a.columnLines){a.setColumnLines(a.columnLines)}a.callParent()},setColumnLines:function(a){var b=this,c=(a)?"addClsWithUI":"removeClsWithUI";b[c]("with-col-lines")}});

  2. you could also specify

    Code:
    maximized: true,
    in your window config.

    stevil

  3. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,572
    Answers
    449
    Vote Rating
    203
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    What if you do a listener for afterrender and they do this.mazimize() (would need to set maximizable: true if you want the user to have the restore tool to then restore it back to the original size)? Would that work for you?
    http://docs.sencha.com/ext-js/4-0/#/...ethod-maximize

  4. #3
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Answers
    15
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    you could also specify

    Code:
    maximized: true,
    in your window config.

    stevil

  5. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,572
    Answers
    449
    Vote Rating
    203
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    Even better.

  6. #5
    Sencha User
    Join Date
    Aug 2011
    Posts
    30
    Answers
    1
    Vote Rating
    0
    Envision123 is on a distinguished road

      0  

    Default


    That worked perfect! Thanks!

    It would be great if you could take a look at this topic I have open as well

    http://www.sencha.com/forum/showthre...Be-Appreciated

    Thanks for your time and support.

  7. #6
    Sencha User
    Join Date
    Aug 2011
    Posts
    30
    Answers
    1
    Vote Rating
    0
    Envision123 is on a distinguished road

      0  

    Default


    I am currently using the Desktop sample. This did work when clicking on options in the Start Menu, however the windows aren't opening 100% when clicking on items on the desktop. Any ideas why those aren't working?

Thread Participants: 2