Hi Pete,
You are very welcome. I've looked at the table.dryml source code and it
seems like we don't have that option yet (it would be a nice candidate
to improve BTW, please feel free to open an issue if you think it's
important).
As a workaround, you should be able to replace the whole heading row:
<field-heading-row:>
<th>Column 1</th>
<th>Column 2</th>
<th>Super Controls</th>
</field-heading-row:>
Warm regards,
Ignacio
El 19/05/14 14:41, Pete escribió:
> Ah brilliant!
>
> Thank you that is perfect!
>
> I was thinking the context was still within the table, and not the
> heading 'state' element!
>
> On a similar subject - when you have transition buttons in <controls:>
> is it possible for these to have a heading within that table - as by
> default it is blank?
>
> Pete
>
>
> On Monday, 19 May 2014 13:02:14 UTC+1, Ignacio Huerta wrote:
>
> Hi Pete,
>
> You code looks great, there's just a small detail missing: instead of
> "this.state", you should use "this", when you are inside the
> <state-view:> tag. Like this:
>
> <state-view:>
>
> <% if this == "passed" %>
>
> <%= image_tag("icon-tick.png", :style => "vertical-align:middle",
> :border => "0") %>
> <% elsif this == "failed" %>
>
> <%= image_tag("icon-cross.png", :style => "vertical-align:middle",
> :border => "0") %>
>
> <% end %>
>
> </state-view:>
>
> Or if you want something shorter:
>
> <state-view:>
> <%= image_tag((this == 'passed' ? "icon-tick.png" :
> "icon-cross.png"), :style => "vertical-align:middle", :border =>
> "0") %>
> </state-view:>
>
> Warm regards,
> Ignacio
>
> El 19/05/14 13:39, Pete escribió:
> > Hi,
> >
> > Been a while since I was on here, glad to see Hobo still going
> strong!
> >
> > I am trying to manipulate the view within a table plus, and use an
> image
> > instead - this is easily achieved with
> >
> > <state-view:>
> > <%= image_tag("icon-tick.png", :style => "vertical-align:middle",
> > :border => "0") %>
> > </state-view:>
> >
> > and then the 'state' gets the image view
> >
> > However, I would like this to change depending on the 'state'
> (this is a
> > transition set up in the model)
> >
> > So two states are 'passed' and 'failed'
> >
> > is there a way of using conditionals to use a different image
> depending
> > on the result of the state?
> >
> > i.e like this:
> >
> > <table-plus:results fields="test, test.description, test.test_group,
> > state" without-search-form>
> >
> > <state-view:>
> >
> > <% if this.state == "passed" %>
> >
> > <%= image_tag("icon-tick.png", :style => "vertical-align:middle",
> > :border => "0") %>
> > <% elsif this.state == "failed" %>
> >
> > <%= image_tag("icon-cross.png", :style => "vertical-align:middle",
> > :border => "0") %>
> >
> > <% end %>
> >
> > </state-view:>
> >
> > Many thanks in advance
> >
> > Pete
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Hobo Users" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to [email protected] <javascript:>
> > <mailto:[email protected] <javascript:>>.
> > To post to this group, send email to [email protected]
> <javascript:>
> > <mailto:[email protected] <javascript:>>.
> > Visit this group at http://groups.google.com/group/hobousers
> <http://groups.google.com/group/hobousers>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Hobo Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/hobousers.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.