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

      0  

    Default Menus Not Opening - Any Help Will Be Appreciated

    Menus Not Opening - Any Help Will Be Appreciated


    I am currently using the 4.0.0 Ext JS Desktop sample and have this in my classes.js file:

    And I have this which adds the above to my start menu on the right side:

    Code:
    Ext.define("MyDesktop.App",{extend:"Ext.ux.desktop.App",requires:["Ext.window.MessageBox","Ext.ux.desktop.ShortcutModel","MyDesktop.SystemStatus","MyDesktop.ForumWindow","MyDesktop.MarketWindow","MyDesktop.DashboardWindow","MyDesktop.ExtrasWindow","MyDesktop.BogusModule","MyDesktop.Settings"],init:function(){this.callParent()},getModules:function(){return[new MyDesktop.DashboardWindow(),new MyDesktop.MenusWindow(),new MyDesktop.PagesWindow(),new MyDesktop.PostsWindow(),new MyDesktop.ModulesWindow(),new MyDesktop.FormsWindow(),new MyDesktop.LayoutWindow(),new MyDesktop.UsersWindow(),new MyDesktop.MarketWindow(),new MyDesktop.ExtrasWindow(),new MyDesktop.ForumWindow()]},getDesktopConfig:function(){var b=this,a=b.callParent();return Ext.apply(a,{contextMenuItems:[{text:"Change Settings",handler:b.onSettings,scope:b}],shortcuts:Ext.create("Ext.data.Store",{model:"Ext.ux.desktop.ShortcutModel",data:[{name:"Dashboard",iconCls:"cpu-shortcut",module:"dashboard"},{name:"Marketplace",iconCls:"grid-shortcut",module:"market"},{name:"Free Extras",iconCls:"notepad-shortcut",module:"extras"},{name:"Support Forum",iconCls:"accordion-shortcut",module:"forum"}]}),wallpaper:"wallpapers/Blue-Sencha.jpg",wallpaperStretch:false})},getStartConfig:function(){var b=this,a=b.callParent();return Ext.apply(a,{title:"Welcome to the Admin Panel !",iconCls:"user",height:350,toolConfig:{width:150,items:[{text:"System Configuration",iconCls:"settings",handler:b.onSettings,scope:b},{text:"Email Templates",iconCls:"settings",handler:b.onSettings,scope:b},{text:"Newsletter",iconCls:"settings",handler:b.onSettings,scope:b},{text:"Languages",iconCls:"settings",handler:b.onSettings,scope:b},{text:"File Manager",iconCls:"settings",handler:b.onSettings,scope:b},{text:"System Logs",iconCls:"settings",handler:b.onSettings,scope:b},{text:"Database Backups",iconCls:"settings",handler:b.onSettings,scope:b},{text:"Membership Setup",iconCls:"settings",handler:b.onSettings,scope:b},{text:"Transactions",iconCls:"settings",handler:b.onSettings,scope:b},{text:"Payment Gateways",iconCls:"settings",handler:b.onSettings,scope:b}]}})},getTaskbarConfig:function(){var a=this.callParent();return Ext.apply(a,{quickStart:[],trayItems:[{xtype:"trayclock",flex:1}]})},onLogout:function(){Ext.Msg.confirm("Logout","Are you sure you want to logout?")},onSettings:function(){var a=new MyDesktop.Settings({desktop:this.desktop});a.show()}});Ext.define("Ext.util.Point",{extend:"Ext.util.Region",statics:{fromEvent:function(a){a=(a.changedTouches&&a.changedTouches.length>0)?a.changedTouches[0]:a;return new this(a.pageX,a.pageY)}},constructor:function(a,b){this.callParent([b,a,b,a])},toString:function(){return"Point["+this.x+","+this.y+"]"},equals:function(a){return(this.x==a.x&&this.y==a.y)},isWithin:function(b,a){if(!Ext.isObject(a)){a={x:a,y:a}}return(this.x<=b.x+a.x&&this.x>=b.x-a.x&&this.y<=b.y+a.y&&this.y>=b.y-a.y)},roundedEquals:function(a){return(Math.round(this.x)==Math.round(a.x)&&Math.round(this.y)==Math.round(a.y))}},function(){this.prototype.translate=Ext.util.Region.prototype.translateBy});Ext.define("Ext.Layer",{uses:["Ext.Shadow"],statics:{shims:[]},extend:"Ext.core.Element",constructor:function(b,a){b=b||{};var c=this,d=Ext.core.DomHelper,f=b.parentEl,e=f?Ext.getDom(f):document.body,g=b.hideMode;if(a){c.dom=Ext.getDom(a)}if(!c.dom){c.dom=d.append(e,b.dh||{tag:"div",cls:Ext.baseCSSPrefix+"layer"})}else{c.addCls(Ext.baseCSSPrefix+"layer");if(!c.dom.parentNode){e.appendChild(c.dom)}}if(b.cls){c.addCls(b.cls)}c.constrain=b.constrain!==false;if(g){c.setVisibilityMode(Ext.core.Element[g.toUpperCase()]);if(c.visibilityMode==Ext.core.Element.ASCLASS){c.visibilityCls=b.visibilityCls}}else{if(b.useDisplay){c.setVisibilityMode(Ext.core.Element.DISPLAY)}else{c.setVisibilityMode(Ext.core.Element.VISIBILITY)}}if(b.id){c.id=c.dom.id=b.id}else{c.id=Ext.id(c.dom)}c.position("absolute");if(b.shadow){c.shadowOffset=b.shadowOffset||4;c.shadow=Ext.create("Ext.Shadow",{offset:c.shadowOffset,mode:b.shadow});c.disableShadow()}else{c.shadowOffset=0}c.useShim=b.shim!==false&&Ext.useShims;if(b.hidden===true){c.hide()}else{this.show()}},getZIndex:function(){return parseInt((this.getShim()||this).getStyle("z-index"),10)},getShim:function(){var b=this,c,a;if(!b.useShim){return null}if(!b.shim){c=b.self.shims.shift();if(!c){c=b.createShim();c.enableDisplayMode("block");c.hide()}a=b.dom.parentNode;if(c.dom.parentNode!=a){a.insertBefore(c.dom,b.dom)}b.shim=c}return b.shim},hideShim:function(){if(this.shim){this.shim.setDisplayed(false);this.self.shims.push(this.shim);delete this.shim}},disableShadow:function(){if(this.shadow){this.shadowDisabled=true;this.shadow.hide();this.lastShadowOffset=this.shadowOffset;this.shadowOffset=0}},enableShadow:function(a){if(this.shadow){this.shadowDisabled=false;this.shadowOffset=this.lastShadowOffset;delete this.lastShadowOffset;if(a){this.sync(true)}}},sync:function(b){var i=this,m=i.shadow,g,e,a;if(!this.updating&&this.isVisible()&&(m||this.useShim)){var d=this.getShim(),c=this.getLeft(true),n=this.getTop(true),k=this.getWidth(),f=this.getHeight(),j;if(m&&!this.shadowDisabled){if(b&&!m.isVisible()){m.show(this)}else{m.realign(c,n,k,f)}if(d){j=d.getStyle("z-index");if(j>i.zindex){i.shim.setStyle("z-index",i.zindex-2)}d.show();if(m.isVisible()){g=m.el.getXY();e=d.dom.style;a=m.el.getSize();e.left=(g[0])+"px";e.top=(g[1])+"px";e.width=(a.width)+"px";e.height=(a.height)+"px"}else{d.setSize(k,f);d.setLeftTop(c,n)}}}else{if(d){j=d.getStyle("z-index");if(j>i.zindex){i.shim.setStyle("z-index",i.zindex-2)}d.show();d.setSize(k,f);d.setLeftTop(c,n)}}}return this},remove:function(){this.hideUnders();this.callParent()},beginUpdate:function(){this.updating=true},endUpdate:function(){this.updating=false;this.sync(true)},hideUnders:function(){if(this.shadow){this.shadow.hide()}this.hideShim()},constrainXY:function(){if(this.constrain){var f=Ext.core.Element.getViewWidth(),b=Ext.core.Element.getViewHeight(),k=Ext.getDoc().getScroll(),j=this.getXY(),g=j[0],e=j[1],a=this.shadowOffset,i=this.dom.offsetWidth+a,c=this.dom.offsetHeight+a,d=false;if((g+i)>f+k.left){g=f-i-a;d=true}if((e+c)>b+k.top){e=b-c-a;d=true}if(g<k.left){g=k.left;d=true}if(e<k.top){e=k.top;d=true}if(d){Ext.Layer.superclass.setXY.call(this,[g,e]);this.sync()}}return this},getConstrainOffset:function(){return this.shadowOffset},setVisible:function(e,b,d,g,f){var c=this,a;a=function(){if(e){c.sync(true)}if(g){g()}};if(!e){this.hideUnders(true)}this.callParent([e,b,d,g,f]);if(!b){a()}return this},beforeFx:function(){this.beforeAction();return this.callParent(arguments)},afterFx:function(){this.callParent(arguments);this.sync(this.isVisible())},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide()}},setLeft:function(a){this.callParent(arguments);return this.sync()},setTop:function(a){this.callParent(arguments);return this.sync()},setLeftTop:function(b,a){this.callParent(arguments);return this.sync()},setXY:function(c,a,b,e,d){e=this.createCB(e);this.fixDisplay();this.beforeAction();this.callParent([c,a,b,e,d]);if(!a){e()}return this},createCB:function(c){var a=this,b=a.shadow&&a.shadow.isVisible();return function(){a.constrainXY();a.sync(b);if(c){c()}}},setX:function(a,b,c,e,d){this.setXY([a,this.getY()],b,c,e,d);return this},setY:function(e,a,b,d,c){this.setXY([this.getX(),e],a,b,d,c);return this},setSize:function(a,c,b,d,f,e){f=this.createCB(f);this.beforeAction();this.callParent([a,c,b,d,f,e]);if(!b){f()}return this},setWidth:function(a,b,c,e,d){e=this.createCB(e);this.beforeAction();this.callParent([a,b,c,e,d]);if(!b){e()}return this},setHeight:function(b,a,c,e,d){e=this.createCB(e);this.beforeAction();this.callParent([b,a,c,e,d]);if(!a){e()}return this},setBounds:function(b,h,d,a,c,e,g,f){g=this.createCB(g);this.beforeAction();if(!c){Ext.Layer.superclass.setXY.call(this,[b,h]);Ext.Layer.superclass.setSize.call(this,d,a);g()}else{this.callParent([b,h,d,a,c,e,g,f])}return this},setZIndex:function(a){this.zindex=a;if(this.getShim()){this.shim.setStyle("z-index",a++)}if(this.shadow){this.shadow.setZIndex(a++)}this.setStyle("z-index",a);return this}});
    However, everytime I click on any any of them, I get the popup to change my wallpaper. I just need to basically know how to make them start working like my menu links that are on the left of the start menu...

    I know that everyone here is probably pretty busy and would greatly appreciate it if someone could help be figure this out.

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,052
    Vote Rating
    215
    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 slemmon has much to be proud of

      0  

    Default


    At the risk of sounding picky - any way you could re-post the code in code?
    It has it all pushed together. Hard to read. Would be easier to read if you had it all tabbed out per code-block and such.

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

      0  

    Default


    That is actually how the code is in the sample when you get it from Sencha's demo. But, I just PM'd you a link to where this is happening at to make it easier for you.

    If anyone else wants a link to it to help out, please let me know.

    Thanks for your time!

  4. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,052
    Vote Rating
    215
    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 slemmon has much to be proud of

      0  

    Default


    Looks like those are buttons in a toolbar. Are you setting handlers on them directly? Or are you handling the click event with something above the buttons (bubbled events, mvc controller, etc)?

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

      0  

    Default


    This is my first time messing around with Ext JS so I have just been following the framework in the example. Adding the links in the left of the startmenu wasn't a problem. However, all the links on the right side are just opening up the wallpaper tab so I'm not really sure what I would need to change/add :/

  6. #6
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,052
    Vote Rating
    215
    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 slemmon has much to be proud of

      0  

    Default


    The desktop example seems a weight project for just starting. You'll have lots of deconstructing to do I'm afraid.
    I'm not sure I'd be the best one to help you deconstruct it as I've not done that before myself - not with the desktop example.

    I wish you luck, though.

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

      0  

    Default


    No problem, don't worry about. Hopefully someone else can chime in to help.

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

      0  

    Default


    I am guessing this is just happening because code for the Settings is on that line when it should just be code for loading the windows, but I'm not exactly sure what should be changed there...