You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ollie Glass <ol...@peerindex.com> on 2013/05/23 12:14:50 UTC

Sort functionality in custom Grid headers

Hello,

I need to customise the header text on a Tapestry Grid column. This code does just that, but it removes the sort functionality:

<table class="table table-striped" t:type="grid" t:source="data" t:rowsPerPage="50" t:pagerPosition="bottom">

    <p:specialHeader>Custom header</p:specialHeader>

</table>

How can I restore the sort functionality to this custom header?

Thanks,

Ollie


Ollie Glass
peerindex.com

+44 7776 307 432
@ollieglass


Re: Sort functionality in custom Grid headers

Posted by Ollie Glass <ol...@peerindex.com>.
Sorry, should have added that when I do this, the sorting is lost.

Removing the text from the header, like this, just results in an empty title (although the tooltip component is shown).

  <p:specialHeader>
	<t:tooltip tip="tipData"></t:tooltip>
  </p:specialHeader>

I'd like the component, title and sorting to all appear.


Thanks,

Ollie

On 23 May 2013, at 14:22, Ollie Glass <ol...@peerindex.com> wrote:

> Thank you, that works.
> 
> Is it possible to put a custom component into the header too, like this:
> 
>   <p:specialHeader>Custom header
> 	<t:tooltip tip="tipData"></t:tooltip>
>   </p:specialHeader>
> 
> Best,
> 
> Ollie
> 
> On 23 May 2013, at 11:31, Lance Java <la...@googlemail.com> wrote:
> 
>> Put your header labels in a messages prop file with key propertyName-label
>> 
>> http://tapestry.apache.org/localization.html
> 
> Ollie Glass
> peerindex.com
> 
> +44 7776 307 432
> @ollieglass
> 

Ollie Glass
peerindex.com

+44 7776 307 432
@ollieglass


Re: Sort functionality in custom Grid headers

Posted by Lance Java <la...@googlemail.com>.
That's a bit more difficult. By providing a header block, you are
overriding the default header which contains the sorting logic.

I see 2 options:

1. Include the sort link / image in your custom header block (see
GridColumns component for inspiration)

2. Decorate the default header with a mixin. The mixin adds the tooltip to
the dom after the grid has rendered it's markup.

Re: Sort functionality in custom Grid headers

Posted by Ollie Glass <ol...@peerindex.com>.
Thank you, that works.

Is it possible to put a custom component into the header too, like this:

  <p:specialHeader>Custom header
	<t:tooltip tip="tipData"></t:tooltip>
  </p:specialHeader>

Best,

Ollie

On 23 May 2013, at 11:31, Lance Java <la...@googlemail.com> wrote:

> Put your header labels in a messages prop file with key propertyName-label
> 
> http://tapestry.apache.org/localization.html

Ollie Glass
peerindex.com

+44 7776 307 432
@ollieglass


Re: Sort functionality in custom Grid headers

Posted by Lance Java <la...@googlemail.com>.
Put your header labels in a messages prop file with key propertyName-label

http://tapestry.apache.org/localization.html