Results 1 to 5 of 5

Thread: Getting a reference to a Window's shadow

  1. #1
    Ext JS Premium Member
    Join Date
    Jun 2009
    Location
    Eastern WA, US
    Posts
    78

    Default Getting a reference to a Window's shadow

    Not sure why I am having trouble with this, but what is the preferred way to programmatically show/hide a window's shadow?

    I'd like to slideIn a window, but the shadow doesn't properly follow so I'd like to have it hidden, then display it on the animation callback.

  2. #2
    Ext JS Premium Member
    Join Date
    Jun 2009
    Location
    Eastern WA, US
    Posts
    78

    Default

    Nevermind;

    windowRef.getEl().disableShadow();
    windowRef.getEl().enableShadow();

    very simple.

  3. #3
    Ext JS Premium Member
    Join Date
    Jun 2009
    Location
    Eastern WA, US
    Posts
    78

    Default

    Still have a problem, however. Once a shadow is disabled, you can no longer enable it?

    Maybe there is a better way togo about this?

  4. #4
    Ext JS Premium Member
    Join Date
    Jun 2009
    Location
    Eastern WA, US
    Posts
    78

    Default

    Found a workable solution, but it seems a bit odd.

    windowRef.getEl().shadow.setOpacity(0); // hide
    windowRef.getEl().shadow.setOpacity(50); // show

    I'd rather be able to call the shadow's show/hide method, but the show method results in an error.

  5. #5
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505

    Default

    I got an error at first, too, but then noticed that the shadow's show() method requires a param of the element where the shadow will be shown. See the below example:

    Code:
    Ext.widget('window', {
        autoShow: true
        , width: 200
        , height: 200
        , listeners: {
            afterrender: function () {
                var me = this               
                me.getEl().shadow.hide();
                Ext.defer(function () {
                    me.getEl().shadow.show(me.getEl());
                }, 1000)
            }
            , delay: 1000
        }
    });

Posting Permissions

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