Исходный код вики SearchGridMacro
Редактировал(а) Вячеслав Мясоед 2024-12-06 11:52
Последние авторы
| author | version | line-number | content |
|---|---|---|---|
| 1 | = Macro Parameters = | ||
| 2 | |||
| 3 | {{velocity}} | ||
| 4 | #set ($parameters = $doc.getObjects('XWiki.WikiMacroParameterClass')) | ||
| 5 | |=Name|=Description|=Mandatory|=Default value | ||
| 6 | #foreach ($parameter in $parameters) | ||
| 7 | #set ($mandatory = $parameter.getValue('mandatory') == 1) | ||
| 8 | #if ($mandatory) | ||
| 9 | #set ($mandatory = 'yes') | ||
| 10 | #else | ||
| 11 | #set ($mandatory = 'no') | ||
| 12 | #end | ||
| 13 | |$parameter.getValue('name')|$parameter.getValue('description')|$mandatory|$parameter.getValue('defaultValue') | ||
| 14 | #end | ||
| 15 | {{/velocity}} | ||
| 16 | |||
| 17 | = Usage = | ||
| 18 | |||
| 19 | == Grid layout == | ||
| 20 | |||
| 21 | {{code language="text"}} | ||
| 22 | {{searchGrid class="Help.Applications.Movies.Code.MoviesClass" showHidden="false" sort="title:asc" facets="databaseList1,staticList1"/}} | ||
| 23 | {{/code}} | ||
| 24 | |||
| 25 | The display of the cells within the grid can be customized by creating an UIX for the UIXP ##org.xwiki.contrib.searchgrid.cell##. An example is given in page [[.MovieSearchGridCell]] for displaying Movies in a custom way, the result can be seen on [[.MovieSearchGrid]]. | ||
| 26 | |||
| 27 | == Table layout == | ||
| 28 | |||
| 29 | {{code language="text"}} | ||
| 30 | {{searchGrid id="movies" class="Help.Applications.Movies.Code.MoviesClass" showHidden="false" | ||
| 31 | facets="databaseList1,staticList1" | ||
| 32 | columns="title,longText1,databaseList1,staticList1,date" limit="30"/}} | ||
| 33 | {{/code}} | ||
| 34 | |||
| 35 | |||
| 36 |