User sorting

<< Click to Display Table of Contents >>

Navigation:  Delphi HTML Report Library > Tables >

User sorting

 

To allow user to sort tables by clicking on columns header set METADATA.autosort attribute to true.

You can adjust sort indicators using CSS classes .sort-up and .sort-down

By default they are:

 

.sort-up:after {content: " \25BC"; } 
.sort-down:after {content: " \25B2";

 

When autosort is set to true, <a onclick="this.parent.parent.parent.SortColumn:=this.parent.Col;"> is added to each column header (th) by setting header cell template variables sort-before and sort-after.

So default header cell template now is:

 

<th {{{attributes}}}>{{{sort-before}}}{{value}}{{{sort-after}}}</th>

 

Sorting should not be used on tables having “rowspan” cells.