Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGrid Header Hover CSS Style

    Hi,

    I am able to modify the ListGrid header's style by defining CSS

    ListGrid.setHeaderTitleStyle("Grid-Header");

    However how do I define the the same CSS when on mouse over to the ListGrid's header? because when I do a mouse over/hover on the header it still uses the default style.

    Thanks!

    #2
    You would need to provide a skin for the header and customize the hover class. Look at the skin_style.css file to get an idea. The default class is headerTitle, and the hover style is called headerTitleOver. You would need to define your own skin, can copy and paste the original and change as needed then set the basestyle.

    Comment


      #3
      Thanks! I got it!

      Question though on changing the skin/theme ...
      I have added the graphite theme in the <project name>.gwt.xml
      <inherits name='com.smartclient.theme.graphite.Graphite'/>

      yet when I try to run the application it is still using the Enterprise theme?
      I don't even see the Enterprise theme being inherited in the <project name>.gwt.xml.

      Any thoughts on this one?

      Thanks!

      Comment


        #4
        What does your html look like? Are you using NoScript?

        Comment


          #5
          Yes, my html has a noscript. My html was generated by eclipse. I am using IE v7.0.5730.
          SmartGwt 2.2

          One more thing I realized that there's a Browser Error saying:
          Line: 8
          Char: 1
          Error: 'ics' is undefined
          Code: 0

          I inserted this line in my <project>.gwt.xml file:
          <inherits name='com.smartclient.theme.graphite.Graphite'/>

          Here is my HTML code:
          Code:
          <!doctype html>
          <!-- The DOCTYPE declaration above will set the    -->
          <!-- browser's rendering engine into               -->
          <!-- "Standards Mode". Replacing this declaration  -->
          <!-- with a "Quirks Mode" doctype may lead to some -->
          <!-- differences in layout.                        -->
          
          <html>
            <head>
              <meta http-equiv="content-type" content="text/html; charset=UTF-8">
          
              <!--                                                               -->
              <!-- Consider inlining CSS to reduce the number of requested files -->
              <!--                                                               -->
              <link type="text/css" rel="stylesheet" href="css/Dashboard.css">
          
              <!--                                           -->
              <!-- Any title is fine                         -->
              <!--                                           -->
              <title>Dashboard</title>
              
              <!--                                           -->
              <!-- This script loads your compiled module.   -->
              <!-- If you add any GWT meta tags, they must   -->
              <!-- be added before this line.                -->
              <!--                                           -->
              <script type="text/javascript" language="javascript" src="dashboard/dashboard.nocache.js"></script>
            </head>
          
            <!--                                           -->
            <!-- The body can have arbitrary html, or      -->
            <!-- you can leave the body empty if you want  -->
            <!-- to create a completely dynamic UI.        -->
            <!--                                           -->
            <body>
          
              <!-- OPTIONAL: include this if you want history support -->
              <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
              
              <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
              <noscript>
                <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
                  Your web browser must have JavaScript enabled
                  in order for this application to display correctly.
                </div>
              </noscript>
          
            </body>
          </html>

          Comment


            #6
            You need to set your isomorphic directory, see the FAQ sticky

            Comment


              #7
              Setting of the isomorphic directory is no longer required with Smart GWT 2.2. The question is where is "ics" in the error message coming from? Did you mean "isc"?

              If you are inheriting SmartGwtNoScript, then you need to manually add the SC script includes in your host html file. See the showcase index.html file.

              Edit : If you are inheriting SmartGwtNoScript, then you also need to inherit GraphiteResources, and not the Graphite module. Again, see what the Showcase does.
              Last edited by smartgwt.dev; 21 Jul 2010, 09:50.

              Comment


                #8
                Correction the Browser error was 'isc' not 'ics'.

                I have changed the Inherit graphite from
                <inherits name='com.smartclient.theme.graphite.Graphite'/>
                to
                <inherits name='com.smartclient.theme.graphite.GraphiteResources'/>

                the browser error does not show anymore. But the theme/skin Graphite is still not applied to the app. It is still using Enterprise.

                Here is my project.gwt.xml :

                Code:
                <?xml version="1.0" encoding="UTF-8"?>
                <module rename-to='dashboard'>
                  <!-- Inherit the core Web Toolkit stuff.                        -->
                  <inherits name='com.google.gwt.user.User'/>
                
                  <!-- Inherit the default GWT style sheet.  You can change       -->
                  <!-- the theme of your GWT application by uncommenting          -->
                  <!-- any one of the following lines.                            -->
                  <!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
                  <!-- inherits name='com.google.gwt.user.theme.chrome.Chrome'/>-->
                  <!--  <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
                  <!-- <inherits name='com.smartclient.theme.blackops.BlackOps'/>-->
                  <inherits name='com.smartclient.theme.graphite.GraphiteResources'/>  
                
                  <!-- Other module inherits                                      -->
                  <inherits name='com.smartgwt.SmartGwt' />
                  
                  <!-- Specify the app entry point class.                         -->
                  <entry-point class='com.dashboard.client.Dashboard'/>
                
                  <!-- Specify the paths for translatable code                    -->
                  <source path='client'/>
                  <source path='shared'/>
                
                </module>

                Comment


                  #9
                  You just said that you were inheriting the SmartGwtNoScript module yet you have com.smartgwt.SmartGwt in your module file. The SmartGwt module includes the Enterprise theme by default so you'll need to inherit SmartGwtNoScript instead and add the script includes in your host html file. As mentioned earlier, refer to the SmartGWT Showcase code.

                  Comment


                    #10
                    Ok. I got it!

                    Well basically I just copied the whole contents of the index.html file to my own html and just pointed the necessary directories.

                    I'm not sure thought if I need all those <SCRIPT>s

                    THANKS!!

                    Comment

                    Working...
                    X