1. #1
    Sencha User
    Join Date
    May 2008
    Posts
    32
    Vote Rating
    0
    Caius Caesar is on a distinguished road

      0  

    Default floating toolbar problem

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,404
    Vote Rating
    849
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    What does a floating toolbar get you that a docked toolbar doesn't?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    May 2008
    Posts
    32
    Vote Rating
    0
    Caius Caesar is on a distinguished road

      0  

    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
    North Carolina
    Posts
    305
    Vote Rating
    15
    worthlutz will become famous soon enough

      0  

    Default


    Did you figure this out?

    Worth

  5. #5
    Sencha User
    Join Date
    May 2008
    Posts
    32
    Vote Rating
    0
    Caius Caesar is on a distinguished road

      0  

    Default


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

Thread Participants: 2

Tags for this Thread