1. #1
    Sencha User
    Join Date
    Sep 2012
    Location
    Ljubljana
    Posts
    23
    Vote Rating
    0
    TipyTop is on a distinguished road

      0  

    Default Unanswered: Showing panel with showBy function

    Unanswered: Showing panel with showBy function


    I would like to know if there's solution to my next problem.
    First I create floating panel which is not attached to none element and then I add event listener on a button which shows created panel with function call "showBy(button)". My problem is that the panel is on the beginning shown in the top left corner and then is moved near button. Can I just show panel near button?

    I thought of adding panel to dom with !important display: none, but that is dirty solution.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,014
    Answers
    3491
    Vote Rating
    848
    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


    You can set the hidden config to true and showBy should show it for you.
    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
    Jun 2013
    Posts
    10
    Vote Rating
    0
    offirgolan is on a distinguished road

      0  

    Default


    Bump.

    I have two floating panels. When I click on one the first time, it shows fine (right under the button) but when I click the other one it shows it in the top-left corner of the screen. When I click on the first one again, it fixes itself.

    This is the code thats in my controller:

    Code:
    onFilterButtonTap: function(button, e, eOpts) {       
     if(typeof this.getFilterPopupPanel() === "undefined")
            Ext.create('XXXX.view.FilterPopupPanel');
    
    
            this.getFilterPopupPanel().showBy(button);
        }

  4. #4
    Sencha User
    Join Date
    Jun 2013
    Posts
    10
    Vote Rating
    0
    offirgolan is on a distinguished road

      0  

    Default


    I was able to create a solution to this. Here you go

    Code:
    onUserButtonTap: function(button, e, eOpts) {
            if(typeof this.getUserPopupPanel() === "undefined")
            Ext.create('XXXX.view.PopupPanel');
    
    
            this.getUserPopupPanel().showBy(button);
    
    
            /* BUG FIX: When clicking on button, panel shows at top left of screen, 
            * force it to show near button
            */
            if(this.getUserPopupPanel().getLeft() < 0)
            {
                this.getUserPopupPanel().showBy(button); 
            }
        }

Thread Participants: 2

Tags for this Thread