You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Stephan Windmüller <st...@cs.tu-dortmund.de> on 2010/04/01 09:10:27 UTC
Re: Grid: Customizing cell CSS based on property value
On 31.03.2010 20:31 matias.blasi wrote:
> Although Tapestry Grid don't allow you to specify cell CSS style, you can do
> something like this:
>
> <t:grid t:source="objects" t:row="o">
> <p:somepropertycell>
> <div class="somepropertystyleclass">${o.someproperty}</div>
> </p:somepropertycell>
> </t:grid>
Of course, but I want to change the background-color of the whole cell.
- Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Grid: Customizing cell CSS based on property value
Posted by Dmitry Gusev <dm...@gmail.com>.
Give it another try, like this:
<style>
table.t-data-grid tbody tr td.lastPingSummary { /* here may be
selector for your column */
padding: 0px; /* remove padding from all column cells to avoid
left and right space */
}
.red {
background-color: red;
line-height: 20px; /* set div's line height to remove top-bottom
space */
padding-left: 2px; /* add some padding to your div */
padding-right: 2px;
}
</style>
<t:grid empty="No jobs" source="jobs" row="job" ...>
<t:parameter name="lastPingSummaryCell">
<div class="${summaryStatusCssClass},
red">${lastPingSummary}</div>
</t:parameter>
I just checked this on my app - its working as expected. But I'm using
different way to highlight cells in my app: I'm changing text color in my
div's, I think this looks prettier :)
HTH
On Thu, Apr 1, 2010 at 15:21, Stephan Windmüller <
stephan.windmueller@cs.tu-dortmund.de> wrote:
> Am 01.04.2010 12:28, schrieb matias.blasi:
>
>
> page.tml:
>>
>> <t:grid t:source="objects" t:row="o">
>> <p:somepropertycell>
>> <div class="${somestyleclass}">${o.someproperty}</div>
>> </p:somepropertycell>
>> </t:grid>
>>
>> app.css:
>>
>> .somestyleclass {
>> background-color:red;
>> width: 100%;
>> height: 100%;
>> }
>>
>> doesn't it works?
>>
>
> No, this was my first try. ;)
>
>
> - Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Dmitry Gusev
AnjLab Team
http://anjlab.com
Re: Grid: Customizing cell CSS based on property value
Posted by Stephan Windmüller <st...@cs.tu-dortmund.de>.
Am 01.04.2010 12:28, schrieb matias.blasi:
> page.tml:
>
> <t:grid t:source="objects" t:row="o">
> <p:somepropertycell>
> <div class="${somestyleclass}">${o.someproperty}</div>
> </p:somepropertycell>
> </t:grid>
>
> app.css:
>
> .somestyleclass {
> background-color:red;
> width: 100%;
> height: 100%;
> }
>
> doesn't it works?
No, this was my first try. ;)
- Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Grid: Customizing cell CSS based on property value
Posted by "matias.blasi" <ma...@gmail.com>.
page.tml:
<t:grid t:source="objects" t:row="o">
<p:somepropertycell>
<div class="${somestyleclass}">${o.someproperty}</div>
</p:somepropertycell>
</t:grid>
app.css:
.somestyleclass {
background-color:red;
width: 100%;
height: 100%;
}
doesn't it works?
Stephan Windmüller-8 wrote:
>
> On 31.03.2010 20:31 matias.blasi wrote:
>
>> Although Tapestry Grid don't allow you to specify cell CSS style, you can
>> do
>> something like this:
>>
>> <t:grid t:source="objects" t:row="o">
>> <p:somepropertycell>
>> <div class="somepropertystyleclass">${o.someproperty}</div>
>> </p:somepropertycell>
>> </t:grid>
>
> Of course, but I want to change the background-color of the whole cell.
>
> - Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
View this message in context: http://old.nabble.com/Grid%3A-Customizing-cell-CSS-based-on-property-value-tp28083380p28106874.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org