How to change the Panel Title dynamically

  1. #1

    How to change the Panel Title dynamically

    I'm trying this way, but it doesn't work:


    <ext:MenuPanel ID="MenuPanel1" runat="server" Title="Infos 2" SaveSelection="false" Icon="ApplicationViewList">
    ...
     <Listeners>
       <Click Handler="#{pnlCenter}.title=(#{MenuPanel1}.title);" />
    </Listeners>
    
    ...
    <ext:Panel ID="pnlCenter" runat="server" Title="Infos 1" Padding="5" Region="Center" Margins="5 5 5 5" />
    ....
    any ideas?

    thanks
  2. #2
    Quote Originally Posted by _xpto View Post
    I'm trying this way, but it doesn't work:


    <ext:MenuPanel ID="MenuPanel1" runat="server" Title="Infos 2" SaveSelection="false" Icon="ApplicationViewList">
    ...
     <Listeners>
       <Click Handler="#{pnlCenter}.title=(#{MenuPanel1}.title);" />
    </Listeners>
    
    ...
    <ext:Panel ID="pnlCenter" runat="server" Title="Infos 1" Padding="5" Region="Center" Margins="5 5 5 5" />
    ....
    any ideas?

    thanks
    You can use .setTitle, see

    http://docs.sencha.com/ext-js/4-1/#!...ethod-setTitle

    The client-side docs are your friend.
    Geoffrey McGill
    Founder
  3. #3
    geoffrey, many thanks for your reply but it still doesnt work.

    I've tried:

    <script language="javascript" type="text/javascript">
    var menuItemClick = function (item) {
      pnlCenter.setTitle="Infos 2";
    };
    </script>
    ...
    <Listeners>
       <ItemClick Fn="menuItemClick" />
    </Listeners>
    and this:
    
    <Listeners>
       <Click Handler="#{pnlCenter}.setTitle=(#{MenuPanel1}.title);" />
    </Listeners>
    but no success =(
  4. #4
    sorry, my mistake:

    <script language="javascript" type="text/javascript">var menuItemClick = function (item) {  pnlCenter.setTitle("Infos 2");};</script>
    now it works.

    Thanks =)

Similar Threads

  1. [CLOSED] Trying to dynamically change grid panel columns.
    By GLD in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 29, 2011, 8:41 AM
  2. Replies: 4
    Last Post: Mar 04, 2010, 12:06 PM
  3. [CLOSED] Change colour of title of form group panel
    By Sharon in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 12, 2009, 11:08 AM
  4. [CLOSED] Change Node Name dynamically in tree panel
    By Etisbew in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jun 29, 2009, 10:49 AM
  5. Replies: 2
    Last Post: Feb 19, 2009, 2:02 PM

Posting Permissions