How to open two widgets at the same time in Jewelry Box theme?

3866
10
Jump to solution
04-02-2016 09:28 PM
LeiZhou1
Occasional Contributor

I know in Launch Pad theme, you can open more than one widgets and let them all display on the screen. Is that possible to adjust anything in Jewelry Box theme, so that two widgets can also open and coexist on the screen? Currently once you open one widget, it will close the other open widget on the screen. Thanks!

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Lei,

  If you are talking about the on screen widgets then you open the [install dir]\server\apps\[app#]\jimu.js\OnScreenWidgetIcon.js file and edit the switchToOpen function like this:

switchToOpen: function(){
      this.state = 'opened';

      // this.panelManager.closeAllPanelsInGroup(this.widgetConfig.gid);
      // array.forEach(this.widgetManager.getOnScreenOffPanelWidgets(), function(widget){
      //   if(widget.closeable){
      //     this.widgetManager.closeWidget(widget);
      //   }
      // }, this);

      html.addClass(this.domNode, 'jimu-state-selected');

View solution in original post

10 Replies
RobertScheitlin__GISP
MVP Emeritus

Lei,

  If you are talking about the on screen widgets then you open the [install dir]\server\apps\[app#]\jimu.js\OnScreenWidgetIcon.js file and edit the switchToOpen function like this:

switchToOpen: function(){
      this.state = 'opened';

      // this.panelManager.closeAllPanelsInGroup(this.widgetConfig.gid);
      // array.forEach(this.widgetManager.getOnScreenOffPanelWidgets(), function(widget){
      //   if(widget.closeable){
      //     this.widgetManager.closeWidget(widget);
      //   }
      // }, this);

      html.addClass(this.domNode, 'jimu-state-selected');
James_001
Occasional Contributor II

Robert,

In launchpad theme it is not working? I did the exact same thing.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ifran,

  in the launchpad theme there is no problem opening more than one widget so there is no need for this code.

0 Kudos
James_001
Occasional Contributor II

Robert,

How can I do in launchpad theme? I did try from widget  menu you can select only one at a time, please help me! I want to open more than one widget, let suppose 3 widget on the screen when my app open how can I?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ifran,

   OK opening two widgets at startup is a bit different then just being able to open two widget at runtime (which is what this thread is about). So opening two widget at startup is not supported currently.

0 Kudos
James_001
Occasional Contributor II

Hi Robert,

Is it possible we can open more than two in panel widgets in Jewelry Box theme and also we can add mouse drag option some thing like in Launch Pad theme. Always, appreciate your help!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Irfan,

  If you want more than one widget in the jewelry box drawer then you have to manually edit the apps main config.json and set the maxWidgets to 2 and then manually add another widget to the widgets array. As far as dragging, that would take a lot of work.

0 Kudos
James_001
Occasional Contributor II

Robert,

I added the maxWidget  2, now i can see a + sign came after that from where I can add any widget  form widgets array.  Also,after adding 2nd widget it changes the widgets to Group 0. Somehow, when I open the jewelry box drawer it shows only 1 widget not the 2nd widget?

Is this right you are talking about the left click mouse press drag option when we press the mouse button we can drag and adjust the position of widget on screen?

Thank you for your help!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus
0 Kudos