Select to view content in your preferred language

Dojo in new version 3.7

1380
3
10-14-2013 04:54 AM
WesleyAntal2
Occasional Contributor
I want to know in example https://developers.arcgis.com/en/javascript/jssamples/gp_clipasync.html o dojox.layout.Dock not work in version API 3.7, only version 3.6.

Exists a alternative to work in version 3.7?
0 Kudos
3 Replies
BenFousek
Deactivated User
It's still there and working in 3.7. The sample doesn't seem to work for an unrelated reason. If you are using AMD you need to require dojox/layout/Dock. The legacy floating pane require loaded the dock module.

AMD:
require([
  'dojox/layout/FloatingPane',
  'dojox/layout/Dock',
  'dojo/dom-construct',
  'dojo/_base/window'
], function (FloatingPane, Dock, domConstruct, win) {
  var dock = new Dock({
    //params
  }, domConstruct.create('div', null, win.body()));

  var fp = new FloatingPane({
    //params
    dockTo: dock
  }, domConstruct.create('div', null, win.body()));

  fp.startup();
});
0 Kudos
WesleyAntal2
Occasional Contributor
It's still there and working in 3.7. The sample doesn't seem to work for an unrelated reason. If you are using AMD you need to require dojox/layout/Dock. The legacy floating pane require loaded the dock module.

AMD:
require([
  'dojox/layout/FloatingPane',
  'dojox/layout/Dock',
  'dojo/dom-construct',
  'dojo/_base/window'
], function (FloatingPane, Dock, domConstruct, win) {
  var dock = new Dock({
    //params
  }, domConstruct.create('div', null, win.body()));

  var fp = new FloatingPane({
    //params
    dockTo: dock
  }, domConstruct.create('div', null, win.body()));

  fp.startup();
});



I not using AMD, just try add the require "dojo.require("dojox.layout.Dock");" this example above (https://developers.arcgis.com/en/javascript/jssamples/gp_clipasync.html) and not working. You try without AMD?
0 Kudos
BenFousek
Deactivated User
The sample is working. The dock is there and functioning. The problem is the floating pane is not visible by default and the dock isn't showing for some reason. It might be styling.

You can manually show the floating pane by running
dijit.byId('floater').show()

in the console.

Try moving the divs for the dock and floating pane outside the border container div.

Also try setting the 'map' to 'z-index:1;' and the 'dock' to 'z-index:50;'.

I use a lot of floating panes, but I hide the dock and show floating panes with buttons, etc.
0 Kudos