Select to view content in your preferred language

set the on-screen widget position programmatically

4462
12
Jump to solution
02-24-2017 11:24 AM
LefterisKoumis
Frequent Contributor

I use the _setDesktopPosition function used in the OnScreenWidget.js in my custom widget.js to set the position of a panel at start up but it ignores it.

Ideas?

startup: function () {

html.place(this.domNode, jimuConfig.mapId);

html.setStyle(this.domNode, {
left: 100 + 'px',
right: 'auto',
top: 100 + 'px',
// width: (position.width || this.position.width || this._originalBox.w) + 'px',
// height: (position.height || this.position.height || this._originalBox.h) + 'px'
});

--- -------

---------

},

thank you.

0 Kudos
12 Replies
RobertScheitlin__GISP
MVP Emeritus

Lefteris,

  When using the launchpad theme you should use:

      startup: function() {
        this.inherited(arguments);
        var position = {
          relativeTo: map,
          left: 277,
          top: 225,
          width: 300,
          height: 420
        };
        this.getPanel().setPosition(position);‍‍‍‍‍‍‍‍
      },
MarkCooper5
Frequent Contributor

Does anyone know what needs to be done to achieve this in the tab theme?

Thanks

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Mark,

  Have you tried the above?

0 Kudos