Results 1 to 2 of 2

Thread: Tip: when changing a component to floating, be sure to hide it first

  1. #1
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Vote Rating

    Default Tip: when changing a component to floating, be sure to hide it first

    Just throwing this out there in case anyone else finds it helpful. I was fighting for a while trying to figure out why my code to set a non-floating panel to a floating one caused it to be weirdly offset. This might even ought to be classified as a bug. Anyway, before you remove it from the parent, you need make sure you hide it. Example:

        <link rel="stylesheet" href="sencha/resources/css/sencha-touch-debug.css" type="text/css">
        <script type="text/javascript" src="sencha/sencha-touch-debug.js"></script>  
        <script type="text/javascript">
      onReady: function() {
        float = new Ext.Panel({
          style:'background-color: #C0C0FF',
        mainPanel = new Ext.Panel({
          dockedItems:{xtype:'toolbar', dock:'bottom', items:[
            {xtype:'button', text:'float', handler:function() { makefloat(float) } }
        function makefloat(cmp) {
          cmp.hide();  // comment this out and it screws up
          mainPanel.remove(cmp, false);
          cmp.setPosition(10, 10);
          cmp.hideOnMaskTap = false;
    If you don't do it that way (and to some degree, in that order), it doesn't work right.

    Of course, maybe there's some obscure method I should be using instead and I'm just doing it all wrong anyway.

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Vote Rating


    Thank you for posting this. I've been struggling to get floating to work. Your example is the first case I've seen where it does. Now I'm running amuck with floats =)

Similar Threads

  1. using floating - my component just vanishes, even with absolute pos.
    By DaveC426913 in forum Sencha Touch 1.x: Discussion
    Replies: 6
    Last Post: 26 Nov 2010, 7:39 AM
  2. Replies: 1
    Last Post: 21 Oct 2010, 3:47 PM
  3. Main panel tool tip is overlapping with the component tool tip.
    By bharathslip9 in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 18 Sep 2010, 9:23 AM
  4. changing the focus of the Component
    By josephraja1982 in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 19 Nov 2007, 11:00 PM
  5. [2.0b1] Floating Panel Hide / Show Bug
    By martyn in forum Ext 2.x: Bugs
    Replies: 4
    Last Post: 8 Nov 2007, 2:06 AM

Posting Permissions

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