Struts2-Jquery Grid CSS Editing [closed]

自闭症网瘾萝莉.ら 提交于 2019-12-09 06:42:26

To answer your question: how to create a new jquery theme?

  1. Just like @Andrea mentioned, You should use jQuery ThemeRoller
  2. Define your sj:head like this

    <%@ taglib prefix="s" uri="/struts-tags"%>
    <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
    <html>
      <head>
        <sj:head jqueryui="true" jquerytheme="mytheme" 
                 customBasepath="template/themes"/>
      </head>
      <body>
      </body>
    </html>
    
  3. You should care following style classes.

    • ui-widget-header
    • ui-state-default
    • ui-widget-content

If you want to adjust single style, you can use either CSS selector or jQuery selector to do this.

the plugin will do the rest. Just try it out.

You can change the default theme by using one of the other themes from jQuery, simply changing the import of the jQuery CSS.

You can see them in jQuery ThemeRoller (Gallery tab), and in the Struts2-jQuery Showcase too (using the themeroller combobox on top-right corner).

If none of them satisfies your needs,

just choose the theme closer to what you want, and define a CSS of your,

declaring it AFTER the jQuery CSS import (because order of import of CSSs matters, the last win),

and manually doing the override of every style declaration you need to change;

To easily and quickly see (and experiments with) them, you can use FireBug on FireFox, or similar tools on other browsers.


For example, if you use

.ui-jqgrid tr.ui-row-ltr td{
    border-right-style: dashed;
}

in your CSS, you will have dashed borders for your TDs, no matter which theme are you using.


You could even create your personal jQuery CSS Theme from nothing, but I doubt this is what you are looking for, it wouldn't be a quick work...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!