Hybrid View

  1. #1
    Sencha User
    Join Date
    Nov 2007
    Location
    Lille, France
    Posts
    40
    Vote Rating
    0
    disizben is on a distinguished road

      0  

    Question How to change the scope of 'this' object in the Ext.Resizable.dd.onMouseUp event ?

    How to change the scope of 'this' object in the Ext.Resizable.dd.onMouseUp event ?


    Hi all!

    I'm trying to extend the Ext.Panel object to make it draggable and resizable. Here's my code :

    Code:
    Ext.extend(Ext.ux.InputZone, Ext.Panel, {
        
        setResizable: function(){
        
            if (!this.resizer){
            
                this.resizer = new Ext.Resizable(this.id, {
                    transparent:true,
                    dynamic:true,
                    handles: 's e se',
                    draggable:true,
                    minWidth: this.minWidth || 50,
                    minHeight: this.minHeight || 15
                });
                    
                // install event handlers
                this.resizer.on({
                    beforeresize: {
                        scope: this,
                        fn: function(resizer, e) {
                            // some code here
                        }
                    },
                    resize: {
                        scope: this,
                        fn: function(resizer, width, height, e) {
                            // some code here
                        }
                    }
                }); 
                    
                this.resizer.dd.onMouseUp = function(e){
                    // 'this' refers to the resizer.dd object !
                }  
    
                return this;   
            }        
        } 
    }); // end of extend
    I would like to update some properties of my Ext.ux.InputZone object when I drop it. I've tried the onMouseUp function of the resizer.dd object but I can't access my object in this function ?

    Does anyone know how could I do that ?

    Thanks.
    disizben

  2. #2
    Ext User santosh.rajan's Avatar
    Join Date
    Sep 2007
    Location
    Kannur, Kerala, India
    Posts
    611
    Vote Rating
    0
    santosh.rajan is on a distinguished road

      0  

    Default


    Code:
     this.resizer.dd.onMouseUp = (function(e){
                    // 'this' refers to the resizer.dd object !
                }).createDelegate(this)

  3. #3
    Sencha User
    Join Date
    Nov 2007
    Location
    Lille, France
    Posts
    40
    Vote Rating
    0
    disizben is on a distinguished road

      0  

    Default


    Thank you santosh.rajan, I didn't know this function, and it works great !!

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar