Sclass

From Documentation
Revision as of 08:31, 8 April 2011 by Tomyeh (talk | contribs)


As described in the previous section, Styling Class (aka., sclass) is a way to add CSS styling to a particular component. By default, nothing is assigned to sclass (i.e., empty). Once it is assigned with a non-empty value (HtmlBasedComponent.setSclass(String)), it will be added to the root element as additional CSS class.

For example,

<zk>
<style dynamic="true">
.mydb {
border: 1px solid blue;
}
</style>
<textbox sclass="mydb" value="having Sclass"/>
<textbox value="Without Sclass"/>
</zk>

As shown above, the first textbox is assigned with a sclass called mydb, while the second textbox is not. If you examine the above example with a DOM inspector (such as Firebug), you will find ZK assigns two CSS classes to the first textbox: z-textbox and mydb. That is, the textbox will inherit all CSS styles from the default rules (for z-textbox), while the custom CSS class (mydb in this example) is used to provide additional customization.



Last Update : 2011/04/08

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.