[CLOSED] How to dynamically modify ext.net component font-size ?

  1. #1

    [CLOSED] How to dynamically modify ext.net component font-size ?

    Hi guys,

    I want to dynamically modify the font size of controls I use (for example button, panel title, label, tabpanel title ...).
    The information of the size is loaded from the database. I'm first trying with the button component

    Test.aspx

    <style type="text/css">
        .small 
        {
            font-size:8px;
        }
        .average 
        {
            font-size:20px;
        }
        .big 
        {
            font-size:50px;
        }        
    </style>
    
    
    <script type="text/javascript" language="javascript">
        function Test() {
            var b = Ext.getCmp('ButtonLancer');
            b.removeCls("big");
            b.addCls("small");           
        }
    </script>
    
    
      <ext:Button runat="server" ID="ButtonLancer" Cls="big" Text="Title 1" TextAlign="Center" Width="400" Height="30">
           <Listeners>
               <Click Fn="Test" />
           </Listeners>
     </ext:Button>
    Nothing happen to my button font-size.
    But if I modify my css by adding .x-btn-inner, it works fine :
    .small .x-btn-inner
    {
        font-size:8px;
    }
    .average .x-btn-inner
    {
        font-size:20px;
    }
    .big .x-btn-inner
    {
        font-size:50px;
    }
    Now my questions are : is it the beest way ? how can I do with others controls like panel, label, Treepanel ? Is there a word like x-btn-inner for all of them if yes what are these words ?
    Last edited by Daniil; Dec 05, 2012 at 2:10 PM. Reason: [CLOSED]
  2. #2
    Please wrap all code samples in [CODE] tags.

    Forum Guidelines For Posting New Topics
    More Information Required
  3. #3
    Please take a look on the following code:

    http://forums.ext.net/showthread.php...ll=1#post16286

    In my opnion it's better to use Button instead of x-btn-inner
    <style type="text/css">
        .small BUTTON
        {
        }
    </style>
  4. #4
    Quote Originally Posted by Tactem View Post
    Now my questions are : is it the beest way ? how can I do with others controls like panel, label, Treepanel ? Is there a word like x-btn-inner for all of them if yes what are these words ?
    Do you want to override font accross entire application?

    If this is your case, please take a look on the following post:
    http://forums.ext.net/showthread.php...ll=1#post95351

    Please let me know if you just want to change specific controls
  5. #5
    Hello!

    Yes, you have to use the second set of CSS rules because this is dictated by button's structure and CSS.

    Click image for larger version. 

Name:	button.PNG 
Views:	85 
Size:	44.5 KB 
ID:	5246

    Also, it will be useful to view on @RCN links
  6. #6
    Quote Originally Posted by RCN View Post
    Do you want to override font accross entire application?

    If this is your case, please take a look on the following post:
    http://forums.ext.net/showthread.php...ll=1#post95351

    Please let me know if you just want to change specific controls
    Yes RCN this is my case and it seems work fine. I tried with a panel which contains button and tabpanel, and it works fine. Thank you.
  7. #7
    Quote Originally Posted by RCN View Post
    Please wrap all code samples in [CODE] tags.

    Forum Guidelines For Posting New Topics
    More Information Required
    Ok RCN I will be careful next time.
  8. #8
    Thank you to you guys for your support.

Similar Threads

  1. Font Size Change
    By megang in forum 1.x Help
    Replies: 1
    Last Post: Apr 09, 2012, 10:02 AM
  2. [CLOSED] Modify window colour dynamically
    By peter.campbell in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 27, 2012, 9:00 AM
  3. modify the size of complex control BorderLayout !
    By David_Ensi in forum 1.x Help
    Replies: 7
    Last Post: Nov 26, 2011, 8:29 PM
  4. Modify font-size in GridPanel
    By John_Writers in forum 1.x Help
    Replies: 0
    Last Post: Apr 28, 2010, 5:26 AM
  5. Replies: 0
    Last Post: Feb 22, 2010, 12:24 PM

Posting Permissions