Details
-
New Feature
-
Resolution: Fixed
-
Major
-
1.9 M1, 1.8.2
-
None
-
Medium
-
Description
This will allow to display a live table of data using only one macro call.
Example of generic usage to display data for a XWiki class (here XWiki.XWikiUsers to display all users in the wiki)
{{velocity}} #set($collist = [ "_avatar", "first_name", "last_name", "email"]) #set($colprops = { "first_name" : { "type" : "text" , "size" : 10, "link" : "view"}, "last_name" : { "type" : "text" , "size" : 10, "link" : "view"}, "email" : { "type" : "text" , "size" : 20, "link" : "editor"}, "_avatar" : { "type" : "none" , "size" : 20, "link" : "none", "html" : "true", "sortable":false } }) #set($options = { "className":"XWiki.XWikiUsers", "translationPrefix" : "xe.index.users." }) #livetable("userstable" $collist $colprops $options) {{/velocity}}
Exemple of usage with a custom result URL and a custom javascript callback to build the table entries :
{{velocity}} #set($collist = ["doc.name", "doc.space","doc.date", "doc.author", "actions"]) #set($colprops = { "doc.name" : { "type" : "text" , "size" : 10, "link" : "view"}, "doc.space" : { "type" : "text" , "size" : 10, "link" : "space"}, "doc.date" : { "type" : "date" }, "doc.author" : { "type" : "text" , "size" : 10, "link" : "author"}, "actions" : {"sortable": false} }) #set($options = { "url":"$xwiki.getURL('XWiki.Tableresults')?xpage=plain", "callback" : "displayAllDocs", "translationPrefix" : "xe.index." }) #livetable("alldocs" $collist $colprops $options) {{/velocity}}
Attachments
Issue Links
- blocks
-
XE-432 Improve the user directory and provide a link to it
- Closed
- is related to
-
XWIKI-3705 Clean and enhance the javascript Live Table component
- Closed
- relates to
-
XRENDERING-24 Complete advanced table syntax for XWiki 2.0 rendering
- Open