Results 1 to 4 of 4

Thread: Is there a way to see what events are firing?

  1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    22
    Vote Rating
    0
      0  

    Default Is there a way to see what events are firing?

    I have a roweditor that after I resize or move columns, then open roweditor, the roweditor does not match the new configuration. If I reload the page then it is correct.

    I looked at the source (roweditor)and see there are what appears to be functions to handle this, but I am guessing for some reason that code is not executing.

    Is there a way to see if that code is running?

  2. #2
    Ext JS Premium Member
    Join Date
    Mar 2009
    Location
    The 303
    Posts
    11
    Vote Rating
    0
      0  

    Default

    You could always put a breakpoint in the code if you're using Chrome or Firefox with FireBug. However, this is a bug with the RowEditor. The fix we used is something like this:

    Code:
    Ext.override(Ext.ux.grid.RowEditor, {
        initFields: function(){
            var cm = this.grid.getColumnModel(), pm = Ext.layout.ContainerLayout.prototype.parseMargins;
            this.removeAll(false);
            for(var i = 0, len = cm.getColumnCount(); i < len; i++){
                var c = cm.getColumnAt(i),
                    ed = c.getEditor();
                if(!ed){
                    ed = c.displayEditor || new Ext.form.DisplayField();
                } else if(ed.rendered){
                    this.getLayout().configureItem(ed);
                }
                if(i == 0){
                    ed.margins = pm('0 1 2 1');
                } else if(i == len - 1){
                    ed.margins = pm('0 0 2 1');
                } else{
                    if (Ext.isIE) {
                        ed.margins = pm('0 0 2 0');
                    }
                    else {
                        ed.margins = pm('0 1 2 0');
                    }
                }
                ed.setWidth(cm.getColumnWidth(i));
                ed.column = c;
                if(ed.ownerCt !== this){
                    ed.on('focus', this.ensureVisible, this);
                    ed.on('specialkey', this.onKey, this);
                }
                this.insert(i, ed);
            }
            this.initialized = true;
        },
        verifyLayout: function(force){
            if(this.el && (this.isVisible() || force === true)){
                var row = this.grid.getView().getRow(this.rowIndex);
                this.setSize(Ext.fly(row).getWidth(), Ext.isIE ? Ext.fly(row).getHeight() + 9 : undefined);
                var cm = this.grid.colModel, fields = this.items.items;
                for(var i = 0, len = cm.getColumnCount(); i < len; i++){
                    if(!cm.isHidden(i)){
                        var adjust = 0;
                        if(i === (len - 1)){
                            adjust += 3; // outer padding
                        } else{
                            adjust += 1;
                        }
                        fields[i].show();
                        var w = cm.getColumnWidth(i) - adjust;
                        fields[i].setWidth(w);
                        fields[i].width = w;
                    } else{
                        fields[i].hide();
                    }
                }
                this.doLayout();
                this.positionButtons();
            }
        }
    });
    It's kinda brittle, but it's been working for us so far.

  3. #3
    Sencha User
    Join Date
    May 2011
    Posts
    22
    Vote Rating
    0
      0  

    Default

    Hi Kembuco,

    THANK YOU, your code works beautifully!

    I didn't know that I could set breakpoints with firebug...thats really cool! I'm real new to Ext and feel like my head is juustt below water level, but I'm having lots of fun learning it and going through your code to see what it is doing is already increasing my understanding.

    Thanks again!

    jwc

  4. #4
    Ext JS Premium Member
    Join Date
    Mar 2009
    Location
    The 303
    Posts
    11
    Vote Rating
    0
      0  

    Default

    You're welcome. Good luck with the learning process and have fun.

Posting Permissions

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