dojo.connect(disruptionsPolyline, "onClick", function(a){ dojo.stopEvent(a); addInfoWindowCode(a); });
function createFloatingPane(floatingPaneId, paneTitle, tabContainerID) { // /*** floating panes ************************************************/ //add a dock //I don't use the dock for user interaction. You could however make it a region in the container or position it somewhere in the app //If you display the dock, much like the floating panes, you'll need to do some css and dojo work to make it look and function right //So why create a dock? If you don't, dojo will do it for you and you won't like the result (see the example at http://dojotoolkit.org/reference-guide/1.7/dojox/layout/FloatingPane.html#dojox-layout-floatingpane) var dock = new dojox.layout.Dock({ id: "dock", style: 'position:absolute; bottom:0; right:0; height:0px; width:0px; display:none; z-index:0;' //class: "dockClass" }, dojo.create('div', null, dojo.body())); //add a floating pane var floatingPaneAttributes = new dojox.layout.FloatingPane({ id: floatingPaneId, title: paneTitle, resizable: true, //allow resizing closable: true, //we never want to close a floating pane - this method destroys the dijit dockable: true, // yes we want to dock it dockTo: dock, //if you create the floating pane outside of the same function as the dock, you'll need to set as dijit.byId('dock') style: 'position:absolute;top:130px;left:402px;width:420;height:450px;visibility:hidden;z-index:999 !important' //class: "foatingPaneClass" //style: 'position:absolute;top:130px;left:402px;width:240px;height:320px;visibility:hidden;z-index:999 !important' //you must set position:absolute; and provide a top and left value (right and bottom DO NOT WORK and will cause the floating pane to appear in strange places depending on browser, for example 125684 pixels right) //Why top and left? The position of a floating pane is a relationship between the top-left corner of dojo.window and the top-left corner of the dijit //you must also set a height and width //z-index is mainly irrelavant as the dijit will control its own z-index, but I always set it to 999 !important to avoid the occasional and mysterious problem of the title and content panes of the floating pane appearing at different z-indexes }, dojo.create('div', null, dojo.body())); floatingPaneAttributes.resize({ w: 420, h: 450 }); //add the TabContainer to the Floating Pane var tc = new dijit.layout.TabContainer({ id: tabContainerID, tabPosition:'bottom', style: "height: 100%; width: 100%;", class: "claro" }); // place the tabcontainer into content pane. // IMPORTANT: SINCE FLOATING PANE IS NOT A "Container", WE MUST ATTACH THE TABCONTAINER TO ITS DOM NODE. tc.placeAt(floatingPaneAttributes.containerNode); // call startup to layout everyone. floatingPaneAttributes.startup(); //Override the close function so the control does not get destroyed floatingPaneAttributes.close = function () { floatingPaneAttributes.minimize(); _isFloatingPaneVisible = false; clearSelectedFeatureLayers(); map.graphics.clear(); toolbarOption = "None"; }; //connect the events dojo.connect(floatingPaneAttributes, 'onFocus', function () { dijit.byId(floatingPaneId).bringToTop() }); dojo.connect(floatingPaneAttributes, 'onShow', function () { dijit.byId(floatingPaneId).bringToTop(); drawToolbar.deactivate(); map.enableMapNavigation(); toolbarOption = "ModifyAttributes" map.disableScrollWheelZoom(); navToolbar.activate(esri.toolbars.Navigation.PAN); }); }
@Diana-
Do you have a screenshot of what that looks like that you could share?
I'm in the same boat and the code provided earlier in this thread didn't work well for me and my own kludgy code to "sense" where my feature is on the map and adjust accordingly is almost more trouble than it's worth.
I did submit an enhancement idea for ESRI to add an option to map creation so that the API takes care of all this. It's ESRI's code and they know it better than any one of us. Vote if you're so inclined.
//tabObjectArray is an array of custom object with the following properties // { TabOrder: tabConfig.GroupOrder, TabTitle: tabConfig.Title, TabContent: "<div id='" + tabConfig.DivHolderId + "' ></div><br /><br />" } function addTabPagesToTabControl(tabControl, tabObjectArray) { require(["dojo/_base/array", "dijit/layout/ContentPane"], function (array, contentPane) { if (tabControl.hasChildren()) { var tabControlChildren = tabControl.getChildren(); //work still in progress, need to remove all child nodes (I think) alert("tabcontrol has children count = " + tabControlChildren.length); }; array.forEach(tabObjectArray, function (tabObject) { var tabPage = new contentPane({ title: tabObject.TabTitle, content: tabObject.TabContent }); tabControl.addChild(tabPage); }); }); } function showAttributePane() { var attributePane = dijit.byId(_floatingPaneId); if (attributePane) { disableToolbars(); attributePane.show() } }
Thank you so much. This is just what I was looking for.