1. #1
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    89
    Vote Rating
    1
    sanjay_1985 is on a distinguished road

      0  

    Default Update HTML content of panel added to a window

    Update HTML content of panel added to a window


    Hi,
    I have a panel added to a window.I need to update the HTML content of the panel dynamically.I set the html content by
    panel.html='HTML content';
    panel.doLayout();
    window.show();//the pane is one of the items of window

    Now next time if i try to update the html content

    panel.html='HTML content updated....';
    panel.doLayout();
    its not updated in the screen.Please note that the window is already open.

    Thanks in advance

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,198
    Vote Rating
    120
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    No need to layout, each Panel has 3 different Ext.Element's associated with it header, body and footer which you can manipulate.

    Code:
    panel.body.update('HTML content updated...');
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    89
    Vote Rating
    1
    sanjay_1985 is on a distinguished road

      0  

    Default thks a lot

    thks a lot


    HI,
    thanks a lot for replying.
    I have one more doubt.
    I have three grids added to a window.I want to collapse the grids programatically.
    i tried grid1.collapsed=true;
    but it does not reflect in the screen.How do i resolve this?

  4. #4
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,198
    Vote Rating
    120
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    You are attempting to set private properties of the object.

    After you have constructed your class you can no longer set properties like this, you must call the appropriate methods.
    http://extjs.com/deploy/dev/docs/?cl...ember=collapse
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  5. #5
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    89
    Vote Rating
    1
    sanjay_1985 is on a distinguished road

      0  

    Default hi

    hi


    Hi,
    thks for reply
    Last edited by sanjay_1985; 13 Apr 2009 at 12:14 AM. Reason: typo

  6. #6
    Ext User
    Join Date
    Jan 2008
    Posts
    3
    Vote Rating
    0
    rvwong is on a distinguished road

      0  

    Thumbs up Great advice why isn't it in the Beginners Tutorial?

    Great advice why isn't it in the Beginners Tutorial?


    Thank you Aaron! I'm glad someone else asked this question. But I'm puzzled this is basic stuff that is not obvious. Dynamically updating or programatically updating text content in an extjs panel is like probably the 2nd or 3rd thing most programmers coming to extjs will want to do. I know I certainly wanted to do that after I did the first "Hello World" type example with static content, my next question is ok how do I change that content from my program? and that was not obvious. Might I suggest someone at extjs move your very handy tip here to the Tutorial section?? Thanks... Ray

  7. #7
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,198
    Vote Rating
    120
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Quote Originally Posted by rvwong View Post
    Thank you Aaron! I'm glad someone else asked this question. But I'm puzzled this is basic stuff that is not obvious. Dynamically updating or programatically updating text content in an extjs panel is like probably the 2nd or 3rd thing most programmers coming to extjs will want to do. I know I certainly wanted to do that after I did the first "Hello World" type example with static content, my next question is ok how do I change that content from my program? and that was not obvious. Might I suggest someone at extjs move your very handy tip here to the Tutorial section?? Thanks... Ray
    Ray -

    The entire Learn section of our site is a community wiki which community members, like yourself are able to contribute to. Check it out http://extjs.com/learn
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  8. #8
    Sencha User
    Join Date
    Oct 2012
    Location
    Hyderabad,india
    Posts
    13
    Vote Rating
    0
    reddy479 is on a distinguished road

      0  

    Default How to get html content of a panel

    How to get html content of a panel


    Hi ,
    This is Ranjithreddy, i am new to ExtJs.
    I have been facing a problem in panels for getting panel html content.

    xtype : 'panel',
    id : 'first_block',
    html : '<p>Hi this is belongs to first block.</p>',
    listeners : {
    render : function(c) {
    c.body.on('click', function() {
    alert('' + this.id);
    alert(Ext.getCmp('first_block').items.getAt(0) .getValue());
    });
    }

    I am not getting html content, but i am getting id like "first_block-body".
    Could you please help me out.
    Thanks in advance.