Results 1 to 5 of 5

Thread: floating toolbar problem

  1. #1

    Default floating toolbar problem

    I want a floating toolbar in a container. I succeed nicely, (I add the toolbar as item, set floating to true and use the alignTo function) but I have one problem. When the container is not visible (for instance if it is a tab in a tabpanel with another active tab), the toolbar remains visible, It shines through, so to speak.

    I would think it needs a floatparent, but according to documentation the floatparent must be a floating container. The container of the toolbar is not floating.

    Does anybody have any idea? Below is my definition of the floating toolbar.

    Cheers,
    Caius

    Code:
        //floatin toolbar, to be used in container (just add as item).
        //the toolbar is only visible during mouseover
        Ext.define('Ext.ux.floating.Toolbar', {
            extend: 'Ext.toolbar.Toolbar',
            alias: "widget.floatingtoolbar",
            constructor: function (config) {
                config = config || {};
                config.cls = (config.cls || '') + ' floatingtoolbar';
                config.floating = true,
                config.shadow = false;
                if (!config.location) { config.location = "tr-tr?" }
                this.callParent(arguments);
            },
            tieToOwner: function () {
                this.myOwner.mon(this.myOwner, 'resize', function () { this.alignTo(this.myOwner, this.location) },this);
                this.myOwner.mon(this.myOwner, 'move', function () { this.alignTo(this.myOwner, this.location) }, this);
                this.myOwner.mon(this.myOwner, 'destroy', function () { this.hide(); this.destroy() }, this);
                this.show();
                this.ownerCt = this.myOwner;
                Ext.defer(function () {
                    this.alignTo(this.myOwner, this.location);
                    if (this.addedHidden) { this.hide() }
                }, 1, this);
            },
            onAdded: function () {
                this.callParent(arguments);
                this.myOwner = this.ownerCt;
                this.addedHidden = this.rendered ? this.hidden : this.initialConfig.hidden;
                if (this.myOwner.rendered) {
                    this.tieToOwner()
                } else {
                    this.myOwner.mon(this.myOwner, "afterrender", this.tieToOwner, this, { single: true })
                };
            },
            onRemoved: function () {
                this.callParent(arguments);
                this.hide();
                this.destroy();
            }
        });

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,451

    Default

    What does a floating toolbar get you that a docked toolbar doesn't?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3

    Default

    The toolbar itself does nothing different, but in this case it is essential that the toolbar does not take up space.

    In fact I got multiple objects on a canvas (think dashboard: tables and charts) and the toolbar is for 'design mode' to make changes to the dashboard. When designing, the dashboard must look the same as when viewing, so there's no room for a docked toolbar.

  4. #4
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Hillsborough, NC
    Posts
    447

    Default

    Did you figure this out?

    Worth

  5. #5

    Default

    I changed the design so I could do without floating toolbars, so the answer is no.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •