0

What's the difference of class, sclass and zclass?

asked 2018-04-12 09:11:27 +0800

joaopmi gravatar image joaopmi
5 1

i can't understand yet, can someone explain to me with your own words?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-04-12 15:32:09 +0800

cor3000 gravatar image cor3000
6280 2 7

zclass determines the style prefix used by ZK internally to define the overall look and feel of components based on the current theme: All ZK components have a default zclass with acts as the basic styleclass and prefix for nested dom elements (e.g. <button> has .z-button, <window> has .z-window, z-window-content ... and so on). Unless you want to remove the theme styles from a specific component you don't change the zclass.

More often you'll use the sclass to add additional styles to a component e.g. <button sclass="myLargeButton">.

Which will then render a button tag with both the default zclass and your additional sclass(es).

class is simply a synonym for sclass as you can see in the source code of HtmlBasedComponent it directly calls setSclass.

In most cases you simply use sclass to add custom styles instead of replacing all default styles from the current theme.

Here an example illustrating this:

http://zkfiddle.org/sample/14arbeb/1-sclass-zclass

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2018-04-12 09:11:27 +0800

Seen: 68 times

Last updated: Apr 12 '18

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More