PDA

View Full Version : [CLOSED] How to add a function like "Desktop Switching"?



mis@adphk.com
Nov 11, 2014, 6:25 AM
Hi,

I want my desktop can switch like this.
In different desktop, Show different Shortcut&wallpaper.
how can I do?

Thanks
http://forums.ext.net/attachment.php?attachmentid=16091&stc=1http://forums.ext.net/attachment.php?attachmentid=16101&stc=1

Daniil
Nov 11, 2014, 3:57 PM
Hi @mis,

There is no such the functionality built-in, but it should be possible to implement from scratch.

1. Have you already put the numbers at the top as you have on the screenshot or it is just a mockup?

2. As for setting a wallpaper on the fly, it appears to be an easy part.

App.Desktop1.getDesktop().setWallpaper("wallpaper.png");

3. Managing shortcuts is a more complicated task. I think there should be a possibility to remove and add shortcuts on the fly.

Please look at the addModule method here.
http://svn.ext.net/premium/trunk/Ext.Net/Build/Ext.Net/ux/desktop/js/App.js

It adds a module on the fly and a shortcut if defined. I would recommend you to try to "exctract" the code for adding a shortcut.

You can try the same "technique" to determine how to remove a shortcut.

I would also consider a possibility to show and hide of shortcuts as an alternative of adding and removing. Once I've came up with an example for Ext.NET v1.
http://forums.ext.net/showthread.php?13893&p=57850&viewfull=1#post57850

Hopefully that helps you to start implementing such a nice feature. You are welcome to share a solution when ready:)

mis@adphk.com
Nov 12, 2014, 8:29 AM
Thanks. Mr Daniil,

I got some inspiration.

The Shortcut can hide by "Hidden" property. Could we set the Shortcut property as javascript property? Use a button event. When we press the button, some of the Shortcuts are hidden(not all). other buttons can hide other Shortcuts.

Actually, I just want to use a set of buttons to control the display of shortcuts.

Daniil
Nov 12, 2014, 3:54 PM
Unfortunately, I don't see an API way to manage the Hidden property on the fly.


Please look at the addModule method here.
http://svn.ext.net/premium/trunk/Ext.Net/Build/Ext.Net/ux/desktop/js/App.js

It adds a module on the fly and a shortcut if defined. I would recommend you to try to "exctract" the code for adding a shortcut.

You can try the same "technique" to determine how to remove a shortcut.

Please clarify have you considered that?