Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.
  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    22
    Vote Rating
    1
    rpsirois is on a distinguished road

      0  

    Default #setTitle( undefined )

    #setTitle( undefined )


    Ext version tested:
    • Sencha Touch 2.1
    Browser versions tested against:
    • Chrome 20.0.1132.57
    Description:
    • Ext.Toolbar - #setTitle( undefined ) causes a render error.
    Steps to reproduce the problem:
    • new Ext.Toolbar().setTitle( undefined )
    The result that was expected:
    • I should think that it would simply clear the title
    The result that occurs instead:
    • Uncaught TypeError: Cannot read property 'firstChild' of undefined
    • sencha-touch-all-debug.js:11842
    Test Case:
    see reproduce

    HELPFUL INFORMATION

    Operating System:
    • Mac OS X 10.6.8

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,073
    Vote Rating
    854
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Can I get a test case? Tested against 2.1.0 b1, 2.0.2 and 2.0.1.1 with both these test cases and do not get an error:

    Code:
    new Ext.Toolbar().setTitle(undefined);
    Code:
    var cnt = new Ext.Container({
        fullscreen : true,
        items      : [
            {
                xtype  : 'toolbar',
                docked : 'top'
            }
        ]
    });
    
    var toolbar = cnt.down('toolbar');
    
    toolbar.setTitle(undefined);
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    22
    Vote Rating
    1
    rpsirois is on a distinguished road

      0  

    Default


    Thanks for the response.

    Hmm I didn't try a unit test. It doesn't throw an error this way (not sure what I screwed up in my code); however, setting the title after passing undefined doesn't seem to work.

    Code:
    var cnt = new Ext.Container({    fullscreen : true,    items      : [        {            xtype  : 'toolbar',            docked : 'top'        }    ]});var toolbar = cnt.down('toolbar');toolbar.setTitle(undefined);toolbar.setTitle('some title');

  4. #4
    Sencha User
    Join Date
    Jul 2012
    Posts
    22
    Vote Rating
    1
    rpsirois is on a distinguished road

      0  

    Default


    Ugh that didn't format very well.

    Code:
    var cnt = new Ext.Container({
        fullscreen : true,
        items      : [
            {
                xtype  : 'toolbar',
                docked : 'top'
            }
        ]
    });
    
    
    var toolbar = cnt.down('toolbar');
    
    
    toolbar.setTitle(undefined);
    toolbar.setTitle( 'some title' );

  5. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,073
    Vote Rating
    854
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    This is working for me:

    Code:
    var cnt = new Ext.Container({
        fullscreen : true,
        items      : [
            {
                xtype  : 'toolbar',
                docked : 'top'
            }
        ]
    });
    
    var toolbar = cnt.down('toolbar');
    
    toolbar.setTitle(undefined);
    
    toolbar.setTitle('Test');
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #6
    Sencha User
    Join Date
    Jul 2012
    Posts
    22
    Vote Rating
    1
    rpsirois is on a distinguished road

      0  

    Default


    Not really sure. I put a workaround in for now anyway.

    Here's the exact build I'm using:

    (debug version)
    Build date: 2012-06-04 15:34:28 (d81f71da2d56f5f71419dc892fbc85685098c6b7)

  7. #7
    Sencha User
    Join Date
    Jul 2012
    Posts
    22
    Vote Rating
    1
    rpsirois is on a distinguished road

      0  

    Default


    This bug still exists in 2.1.0.

Thread Participants: 1