Documentation
Parameters
- TYPE: the TopicType to be searched for, defaults to BASETOPIC
- FIELDS: columns of formfields to display, defaults to TopicTitle, Summary, WikiApplication, Changed
- SORT: sorting of rows, defaults to "Changed"
- REVERSE: sorting direction, defaults to "off", defaults to "on" if SORT="Changed"
- ROWS: number of rows to display initially, defauts to 10
- FILTER: additional filter expression (optional)
- THEWEB: web to examin, defaults to BASEWEB
- ROWNUMBERS: boolean toggle to switch on/off row numbers
- SELECTING: boolean toggle to switch on/off row selection, defaults to off
- SEARCHMODE: either have one single search box using
global
or one per column using multi
, default global
- <field_name>_title: column title for the given field
- <field_name>_width: column width for the given field
Implementation
Using
JQDataTablesPlugin
%STARTINCLUDE%<noautolink>
%DATATABLE{
class="foswikiFlatTable foswikiStripes"
query="TopicType=~'\b%TYPE{default="%BASETOPIC%"}%\b' %IF{"defined FILTER" then="AND %FILTER%"}%"
web="%THEWEB{default="%BASEWEB%"}%"
topic="%BASEWEB%.%BASETOPIC%"
columns="%IF{"'%ROWNUMBERS{default="on"}%'='on'" then="index,"}%%FIELDS{default="TopicTitle,Summary,WikiApplication,Changed"}%"
rows="%ROWS{default="10"}%"
filterbar="on"
toolbar="on"
sort="%SORT{default="Changed"}%"
reverse="%REVERSE{default="%IF{"'%SORT{default="Changed"}%'='Changed'" then="on" else="off"}%"}%"
paging="on"
savestate="on"
searching="on"
searchmode="%SEARCHMODE{default="global"}%"
width="100%"
info="on"
ordering="on"
lengthmenu="5,10,20,30,50,100"
WikiApplication_title="%TRANSLATE{"Application"}%"
TopicTitle_title="%TRANSLATE{"Title"}%"
Summary_title="%TRANSLATE{"Summary"}%"
Changed_title="%TRANSLATE{"Changed"}%"
%FORMATLIST{"%FIELDS{default="TopicTitle,Summary,WikiApplication,Changed"}%"
split="\s*,\s*"
format="$percntIF{\"defined $1_title\"
then=\"$1_title=\\"$percnt$1_title$percnt\\"\"
}$percnt"
separator="$n"
}%
%FORMATLIST{"%FIELDS{default="TopicTitle,Summary,WikiApplication,Changed"}%"
split="\s*,\s*"
format="$percntIF{\"defined $1_width\"
then=\"$1_width=\\"$percnt$1_width$percnt\\"\"
}$percnt"
separator="$n"
}%
%IF{"'%SELECTING{default="off"}%'='on'"
then="selecting=\"on\" selectionmode=\"multi\" selectproperty=\"Topic\""
}%
}%</noautolink>
%STOPINCLUDE%
Test