Results 1 to 9 of 9

Thread: Update html:

  1. #1

    Default Update html:

    Hi,
    please, how do I update panel's "html" attribute? I mean:

    Code:
    var panel = Ext.Panel({
        id: 'panel',
        html: 'some html'
    };
    and after some event I would like to change it so 'some other html'.

    Something like:
    Code:
    Ext.getCmp('panel').html = 'some other html';
    Ext.getCmp('panel').doLayout();
    which unfortunately doesn't work...

    PS: Ext.getCmp('panel').add({html: 'some other html'}); works but then I have to remove the previous html every time... Is it possible just to update it? (No remove / add)

  2. #2

    Default

    Code:
    Ext.getCmp('panel').update('some other html');

  3. #3

    Default

    I tried that too, but Firebug says that "update" is not a function...

  4. #4
    Sencha User
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966

    Default

    Try:

    Code:
    var panel = new Ext.Panel({

  5. #5

    Default

    That doesn't work too.

    The panel is inside of a tabpanel, Ext.getCmp() returns it. deferredRender is false.
    Here's what Firebug tells about it:

    Code:
    baseCls: "x-panel",
    bodyCls: "x-panel-body",
    ctype: "Ext.component",
    defaultType: "panel",
    xtype: "panel"

  6. #6

    Default

    Yes, and I can add new html to it, via:
    Code:
    Ext.getCmp('panel').add({html: '....'});

  7. #7

    Default

    sorry, my bad, update has to be called on the underlying Element:
    Code:
    Ext.getCmp('panel').getEl().update('some other html');

  8. #8

    Default

    Yes, it works!! Thank you!

  9. #9
    Sencha User
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966

    Default

    That should be:

    Code:
    Ext.getCmp('panel').body.update('some other html');

Posting Permissions

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