0

How to specify multiple styles using sclass attribute?

asked 2009-09-10 13:08:17 +0800

baskaraninfo gravatar image baskaraninfo
536 2 2 9

Example code:

<zk>
	<style>
		.mybandbox .z-bandbox .z-bandbox-inp {
		background: #F0F } .mycombobox .z-combobox .z-combobox-inp {
		background: #F0F }
	</style>
	<window title="Style Demo" border="normal">
		<grid id="receiptsGrid" sclass="mybandbox">
			<columns>
				<column label="" />
				<column label="" />
			</columns>
			<rows>
				<row>
					<bandbox buttonVisible="false">
						<bandpopup></bandpopup>
					</bandbox>
					<combobox buttonVisible="false">
						<comboitem label="" />
						<comboitem label="" />
					</combobox>
				</row>
				<row>
					<bandbox buttonVisible="false">
						<bandpopup></bandpopup>
					</bandbox>
					<combobox buttonVisible="false">
						<comboitem label="" />
						<comboitem label="" />
					</combobox>
				</row>
			</rows>
		</grid>
	</window>
</zk>

I have declared two styles, one for bandbox and the other for combobox.
But, in the grid how can I specify both in sclass attribute?

Otherwise, can I have two sets under a single style name?

I tried as below, but it doesn't works for me:

<style>
		.mybandbox .z-bandbox .z-bandbox-inp .z-combobox .z-combobox-inp {
		background: #F0F }
	</style>

Note: I know that, I can individually specify the sclass to individual components in the grid. But, I want to check whether there is any other efficient way of doing the same.

Thanks.

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2009-09-10 13:11:24 +0800

comanche gravatar image comanche
42

Dear baskaraninfo,

You can specify multiple classes, separating them with whitespaces: <tag sclass="class1 class2" />

link publish delete flag offensive edit

answered 2009-09-10 13:11:32 +0800

baskaraninfo gravatar image baskaraninfo
536 2 2 9

updated 2009-09-10 13:28:31 +0800

I have achieve this by setting the style as default as shown below:

<style>
		.z-bandbox .z-bandbox-inp {
		background: #F0F } .z-combobox .z-combobox-inp {
		background: #F0F }
	</style>

But, I have bandbox and combobox outside the grid, which should not be affected by my custom style.

Thanks.

link publish delete flag offensive edit

answered 2009-09-10 13:13:15 +0800

baskaraninfo gravatar image baskaraninfo
536 2 2 9

Thank you, comanche :)

That's the thing am exactly looking for.

link publish delete flag offensive edit

answered 2009-09-10 13:15:26 +0800

comanche gravatar image comanche
42

In your case, both z-combobox and z-bandbox have the same parent - .mybandbox.

A style for bandbox is specified correctly. For combobox it should look like:

.mybandbox .z-combobox .z-combobox-inp ...

link publish delete flag offensive edit

answered 2009-09-10 13:27:29 +0800

baskaraninfo gravatar image baskaraninfo
536 2 2 9

updated 2009-09-10 13:29:49 +0800

I have solved by referring two styles divided by space as you mentioned.

Sorry, I posted without removing the style names.
I have updated my previous post.

Thank you.

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2009-09-10 13:08:17 +0800

Seen: 685 times

Last updated: Sep 10 '09

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