0

What is the best way to change the style of particular components.

asked 2009-08-07 07:35:38 +0800

baskaraninfo gravatar image baskaraninfo
536 2 2 9

I have been using three grid components in all of my screens. I want only the center grid to have some specific style settings such like disabling striping and grid lines. How can I set the style of that without disturbing the other two grids?

If I use the <style> tag or CSS, all the grid component look have been changing.

Do I need to create a custom component by extending the grid and then only I can able to do what I was intended to? Is there any other alternatives?

Thanks.

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2009-08-07 07:43:43 +0800

baskaraninfo gravatar image baskaraninfo
536 2 2 9

I have been using 'sclass="custom_grid"' according to the grid.

I think I want to move my style details inside a separate CSS file and I can refer in all my screens. Then I can specify the style using sclass for each grid.

Any suggestions?

Thanks.

link publish delete flag offensive edit

answered 2009-08-07 08:12:49 +0800

baskaraninfo gravatar image baskaraninfo
536 2 2 9

I have created a custom component as follows:

[Added in lang-addon.xml file]:
<component>
<extends>grid</extends>
<component-name>tpfieldgrid</component-name>
<property>
<property-name>fixedLayout</property-name>
<property-value>true</property-value>
<property-name>oddRowSclass</property-name>
<property-value>none</property-value>
<!--
<property-name>sclass</property-name>
<property-value>"fieldgrid"</property-value>
-->
</property>
</component>

[custom component used as follows]:
<tpfieldgrid>
<columns visible="false">
<column label="" width="24%" />
<column label="" width="30%" />
<column label="" width="4%" />
<column label="" width="1%" />
<column label="" width="13%" />
<column label="" width="30%" />
</columns>
<rows>
<row>
<label value="Location Transfer No"
width="80%" />
<textbox value="" width="80%" />
<image src="" width="80%" />
<label value="" width="80%" />
<label value="From Location" width="80%" />
<combobox width="80%">
<comboitem label="" />
<comboitem label="" />
</combobox>
</row>
<row>
<textbox />
<label value="" width="80%" />
<label value="" width="80%" />
<label value="" width="80%" />
<label value="To Location" width="80%" />
<combobox width="80%">
<comboitem label="" />
<comboitem label="" />
</combobox>
</row>
<row>

</row>
</rows>
</tpfieldgrid>

The problem here is, the custom component exists. But, the associated property settings are not considered.

Am I doing anything wrong?

Thanks.

link publish delete flag offensive edit

answered 2009-08-09 17:32:05 +0800

iantsai gravatar image iantsai
2755 1

Have you tried ZK Studio's Style Designer ever befor?
You can use it to customize your Grid's look & feel follow the ZK Studio's User Guide.
And you can trace the code ZK Studio generated for you to learn how to customize your Grid component.

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-08-07 07:35:38 +0800

Seen: 204 times

Last updated: Aug 09 '09

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