[CLOSED] how to remove class to a tag add and a special class to a tag?

  1. #1

    [CLOSED] how to remove class to a tag add and a special class to a tag?

    hi team
    i want to remove all class="sc_sy" tag in a tag under ul.sc_nav, and add class="sc_sy" tag to the id="nav_4", how to do using ext.net or extjs?
    <ul class="sc_nav">
                        <a id="nav_1"  href="/" class="sc_sy" title="网站首页">网站首页</a>
                        <a id="nav_2"   href="servs.aspx" title="服务内容">服务内容</a>
                        <a id="nav_3"  href="cases.aspx" title="精彩案例">精彩案例</a>
                        <a id="nav_4"  href="compcol.aspx?cid=48" title="新闻资讯">新闻资讯</a>
                        <a id="nav_5"  href="about.aspx" title="关于奇卓">关于奇卓</a>
                    </ul>
    Last edited by Daniil; Feb 25, 2014 at 3:46 AM. Reason: [CLOSED]
  2. #2
    There are lots of options. The following demonstrates one technique.

    Example


    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET Example</title>
    
        <style type="text/css">
            .red {
                color: #f00;
            }
        </style>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Button 
                runat="server" 
                Text="Change Css" 
                OnClientClick="Ext.get('nav_4').radioCls('red');" 
                />
    
            <ul>
                <a id="nav_1" class="red">One</a>
                <a id="nav_2">Two</a>
                <a id="nav_3">Three</a>
                <a id="nav_4">Four</a>
                <a id="nav_5">Five</a>
            </ul>
        </form>
    </body>
    </html>
    The documentation is your friend:

    http://docs.sencha.com/extjs/
    Geoffrey McGill
    Founder
  3. #3
    Quote Originally Posted by geoffrey.mcgill View Post
    There are lots of options. The following demonstrates one technique.

    Example


    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET Example</title>
    
        <style type="text/css">
            .red {
                color: #f00;
            }
        </style>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Button 
                runat="server" 
                Text="Change Css" 
                OnClientClick="Ext.get('nav_4').radioCls('red');" 
                />
    
            <ul>
                <a id="nav_1" class="red">One</a>
                <a id="nav_2">Two</a>
                <a id="nav_3">Three</a>
                <a id="nav_4">Four</a>
                <a id="nav_5">Five</a>
            </ul>
        </form>
    </body>
    </html>
    The documentation is your friend:

    http://docs.sencha.com/extjs/
    how about remove class? I can not find it in above url
  4. #4
    Quote Originally Posted by hdsoso View Post
    how about remove class? I can not find it in above url
    The .removeCls function is two items below .radioCls.

    http://docs.sencha.com/extjs/4.2.2/#...ethod-radioCls

    But, why would you need .removeCls if using .radioCls?
    Geoffrey McGill
    Founder

Similar Threads

  1. query regarding a class
    By svk in forum 1.x Help
    Replies: 0
    Last Post: May 10, 2012, 8:56 AM
  2. CSS class required
    By kondareddy1984 in forum 1.x Help
    Replies: 0
    Last Post: Apr 28, 2011, 7:09 PM
  3. ComboBox - Class
    By Tbaseflug in forum 1.x Help
    Replies: 1
    Last Post: Jun 17, 2009, 7:54 PM
  4. Class with HasMany
    By Maia in forum 1.x Help
    Replies: 0
    Last Post: May 20, 2009, 6:00 PM
  5. css class in gridpanel
    By sonnt in forum 1.x Help
    Replies: 2
    Last Post: Mar 27, 2009, 4:52 AM

Posting Permissions