Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Apr 2009
    Location
    Berkshire, UK
    Posts
    41
    Vote Rating
    0
    treadmill is on a distinguished road

      0  

    Lightbulb [CLOSED] Possible bug on event addClass on line 5846 of ext-all-debug.js (v3.2.0)

    [CLOSED] Possible bug on event addClass on line 5846 of ext-all-debug.js (v3.2.0)


    Hi All,

    I'm not sure if this is actually a bug or just my dumb way I've tried to implement the use of a Toolbar on a form.

    Basically, when submitting a form for data-save, I do a show() of Toolbar with a text message on it and then hide() the Toolbar. However, on a call to getForm().load({}) and performing another data-save, I get the following error:-

    Error: me.dom is undefined
    Source File: http://foobar.com/ext-3.2.0/ext-all.js
    Line: 5846

    No idea why it works the first time and not the next time. The element it's trying to update, does exist, but not in the way ExtJS thinks. So to get around it, I made the following fix to my own ext-all.js file (code highlighted in red) and the problem is resolved.

    Please be aware, I'm a novice JS programmer, so no flaming, as I think this was luck that I managed to find a fix... albeit a possible dirty/nasty fix for all I know. Any questions, please make them quite layman, rather than too technical!

    Code:
            /**
             * Adds one or more CSS classes to the element. Duplicate classes are automatically filtered out.
             * @param {String/Array} className The CSS class to add, or an array of classes
             * @return {Ext.Element} this
             */
            addClass : function(className){
                var me = this, i, len, v;
                className = Ext.isArray(className) ? className : [className];
                for (i=0, len = className.length; i < len; i++) {
                    v = className[i];
                    if (v) {
                        if (!me.dom) me = Ext.get(me.id);
                        me.dom.className += (!me.hasClass(v) && v ? " " + v : "");
                    };
                };
                return me;
            },
    UI: Sencha Architect 3.0.4.x / ExtJS 4 MVC
    Server side:
    PHP
    Databases:
    MySQL

  2. #2
    Sencha User
    Join Date
    Apr 2009
    Location
    Berkshire, UK
    Posts
    41
    Vote Rating
    0
    treadmill is on a distinguished road

      0  

    Default


    I should also mention that the Toolbar also has a custom class to it, in order to show a different background image. Not sure if this is significant, probably not I would think.
    UI: Sencha Architect 3.0.4.x / ExtJS 4 MVC
    Server side:
    PHP
    Databases:
    MySQL

  3. #3
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    The problem is that the component exists but it is not in the dom and you are trying to add a class to the dom. Adding a check like this at the a low level isn't recommended as it masks the true problem. You want to make sure your form is rendered and not destroyed before you attempt adding a class here.

  4. #4
    Sencha User
    Join Date
    Apr 2009
    Location
    Berkshire, UK
    Posts
    41
    Vote Rating
    0
    treadmill is on a distinguished road

      0  

    Question


    Not sure I understand what I should do in my scenario.

    I've done a screen capture, which you can see here:-

    http://admin.peachpublishing.co.uk/bug/index.html

    These are the events of the capture.

    1. I navigate to a menu "The Faithless Wife" and it renders a FormPanel within a parent Panel, and then loads the form data.
    2. I click the "Save book" button to submit the form, which saves the data. Upon success, a Toolbar is displayed to show a save message, which then is hidden.
    3. I navigate to the exact same menu, which as the same as step 1.
    4. When I click save this time, there is a problem with the Toolbar.

    When I click the menu "The Faithless Wife", this what's called - vastly reduced code, but shows the Toolbar in question.

    Code:
    var cPanel = Ext.getCmp('p-right');
    cPanel.removeAll();
    
    cPanel.add({
        xtype: 'form',
        bbar: {
            xtype: 'toolbar',
            height: 25,
            id: 'sbNotifications',
            hideMode: 'display',
            hidden: true,
            cls: 'warningMsg',
            items: [
                    {
                            xtype: 'tbtext',
                            id: 'sbMessages',
                            text: 'Ready.',
                            style: 'color:#FFFFFF; font-weight:bold;'
                    }
            ]
    }
    });
    
    cPanel.doLayout();
    What should I be doing for it to work the 2nd time and so on?
    UI: Sencha Architect 3.0.4.x / ExtJS 4 MVC
    Server side:
    PHP
    Databases:
    MySQL

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."