Results 1 to 6 of 6

Thread: Confusion using alignTo in a viewport based on Ext.example.msg (plz move-> Ext: Help)

  1. #1
    Sencha User
    Join Date
    Dec 2007
    Posts
    43

    Default Confusion using alignTo in a viewport based on Ext.example.msg (plz move-> Ext: Help)

    I am attempting to create a sliding message based on Ext.example.msg within a viewport, and am running into issues whenever attempting to do any alignment based on a bottom anchor point of the element.

    Is my interpretation of 'alignTo' incorrect? Shouldn't the following align the element to the bottom right corner of the viewport?

    Code:
    msgCt.alignTo(document, 'br-br');
    Instead, it appears offscreen, and seems to be aligning the top right of the element to the bottom right of the viewport (target). If I tweak the positioning using the optional offset, then the element begins to come into view.

    the only css i have applied to the sliding element is:

    Code:
    #msg-div {
      width:180px;
      z-index:20000;
    }
    .msg {
      border: 1px solid black;
    }
    Thanks.
    Last edited by danderson; 17 Mar 2009 at 7:30 AM. Reason: Posted in wrong forum. apologies. should be in Ext: Help

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    Works fine for me


  3. #3
    Sencha User
    Join Date
    Dec 2007
    Posts
    43

    Default

    Quote Originally Posted by Animal View Post
    Works fine for me
    Thanks Animal. It appears I was indeed interpreting the API correctly and my issue lies elsewhere. I will revisit it.

  4. #4
    Sencha User
    Join Date
    Dec 2007
    Posts
    43

    Default Still cannot align/anchor a sliding element into the bottom right corner

    I was able to successfully able to align window elements, etc. but still was unable to align an element that needs to slide in from the bottom right corner. Has anyone been able to slide an element into the viewport in such a manner?

  5. #5
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    Calculate the position it needs to slide to, then slide it.

    http://extjs.com/deploy/dev/docs/?cl...r=getAlignToXY

  6. #6
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    Don't just slide the Element. Remember it has a shadow too.

    Use

    Code:
    Ext.override(Ext.Window, {
        slideTo: function(x, y) {
            var a = Ext.lib.Anim.motion(this.el, {left: {to: x}, top: {to: y}});
            a.onTween.addListener(function(){
                this.syncShadow();
            }, this);
            a.onComplete.addListener(function(){
                this.x = x;
                this.y = y;
                a.onTween.clearListeners();
            }, this, {single: true});
            a.animate();
        }
    });

Posting Permissions

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