Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7556341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:50:29+00:00 2026-05-30T11:50:29+00:00

I have a dojox.layout.FloatingPane (as a custom dijit) which can be positioned anywhere within

  • 0

I have a dojox.layout.FloatingPane (as a custom dijit) which can be positioned anywhere within its enclosing div. My problem is that the user can potentially drag the FloatingPane completely outside of its container and be unable to retrieve it. Is there any easy way to force the FloatingPane to remain entirely visible at all times?

Here’s my code:

dojo.provide("ne.trim.dijits.SearchDialog");

dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.require("dojox.layout.FloatingPane");

dojo.declare("ne.trim.dijits.SearchDialog", [dijit._Widget, dijit._Templated], {

templateString: dojo.cache("ne.trim.dijits", "templates/SearchDialog.html"),
initialised:false,
floatingPane: null,

postCreate: function() {
    this.init();
},

init: function() {
    console.debug("SearchDialog.init()", "start");
    if ( this.initialised === false ) {
        this.createSearchDialog();
    }
    //ne.trim.AppGlobals.searchDialog = this;
    console.debug("SearchDialog.init()", "end");        
},

createSearchDialog: function() {
    var node = dojo.byId('searchbox');  
    floatingPane = new dojox.layout.FloatingPane({
         title: "A floating pane",
         resizable: true, dockable: true, constrainToContainer: true,
         style:   "position:absolute;top:100;right:100;width:400px;height:300px;z-index:100",
    }, node );

    this.initialised=true;

    floatingPane.startup();
}

});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T11:50:31+00:00Added an answer on May 30, 2026 at 11:50 am

    First of all, see the working example at jsFiddle: http://jsfiddle.net/phusick/3vTXW/

    And now some explanation;) The DnD functionality of FloatingPane is achieved via dojo.dnd.Moveable class instantialized in pane’s postCreate method. To constrain the movement of the FloatingPane you should use one of these moveables instead:

    • dojo.dnd.parentConstainedMoveable – to constrain by a DOM node
    • dojo.dnd.boxConstrainedMoveable – to constrain by co-ordinates: {l: 10, t: 10, w: 100, h: 100}
    • dojo.dnd.constrainedMoveable – to constrain by co-ordinates calculated in a provided function

    For more details see aforementioned jsFiddle.

    According to documentation you should call destroy() on Moveable instance to remove it, but as FloatingPane‘s original Moveable is not assigned to any object property, I do not destroy it, I just instantiate one of those three moveables on the same DOM node in a subclass:

    var ConstrainedFloatingPane = dojo.declare(dojox.layout.FloatingPane, {
    
        postCreate: function() {
            this.inherited(arguments);
            this.moveable = new dojo.dnd.move.constrainedMoveable(this.domNode, {
                handle: this.focusNode,
                constraints: function() {
                    return dojo.coords(dojo.body());
                }
            });
        }
    
    });
    

    Now you can use ConstainedFloatingPane instead of dojox.layout.FloatingPane:

    var floatingPane = new ConstrainedFloatingPane({
        title: "A Constrained Floating Pane",
        resizable: true
    }, searchboxNode);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a div in which a page is loaded with the DojoX Layout
I have a small web app I wrote that has a Dijit.layout.BorderContainer nested within
I have the following code: <div dojoType=dijit.layout.ContentPane id=filterForm style=padding: 3px> <form dojoType=dijit.form.Form> <input dojoType=dijit.form.TextBox
I have an enhancedGrid backed by a JsonRestStore which displays summary information and can
I have a requirement where I need to create a dojox.layout.ContentPane programmatically. function constructContentPane(methodToBeCalled){
I have some problems getting the custom formated JSON data into a dijit.form.FilteringSelect. It
I have a Dojo Datagrid in one of my pages (which contains more content)
I have Aptana installed within Eclipse. I'm working on a project with the dojo
I am new to dojo. I have three divs; the first div has 10
When evaluating dojo.require statements, dojo tracks which modules and resources have been required and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.