Wiki source code of GridExtension

Last modified by Ecaterina Valica on 2010/01/12 11:29

Show last authors
1 #if("$request.xpage"=="plain") ## temporary allow the bespin editor for extensions
2 #includeInContext("XWiki.SkinEditor")
3 #else
4 1 Grid Extension
5
6 The Grid extension allows to navigate through a list of pages of a specific XWiki class. You'll find a more complete documentation on xwiki.org in the [Drafts Documentation section>http://dev.xwiki.org/xwiki/bin/view/Drafts/XWikiGridComponentTutorial]
7
8 1.1 Installation
9
10 You need to add XWiki.GridExtensionTranslations to the list of Translations bundles in <a href="$xwiki.getURL("XWiki.XWikiPreferences", "admin", "editor=globaladmin&section=Programming&space=XWiki")">your administration screen</a>
11
12 1.1 Example
13
14 Here is an example with users of the wiki. An example for usage [in Syntax 2.0 is also available>GridExtensionSyntax2]:
15
16 1.1.1 Code
17
18 {code}
19 ## syntax 1.0 example
20 #includeMacros("XWiki.GridExtensionMacros")
21 ## optional GWT prop editor
22 #gwtpropeditor()
23 #set($collist = [ "first_name", "last_name","blog", "imtype", "email", "doc.creator", "_attachment", "_avatar"])
24 #set($colprops = {
25 "first_name" : { "type" : "text" , "size" : 10, "link" : "view"},
26 "last_name" : { "type" : "text" , "size" : 10, "link" : "view"},
27 "blog" : { "type" : "text" , "size" : 20, "link" : "none"},
28 "imtype" : { "type" : "list" , "size" : 1, "link" : "none"},
29 "email" : { "type" : "text" , "size" : 20, "link" : "editor"},
30 "doc.creator" : { "type" : "text" , "size" : 20, "link" : "none"},
31 "_attachment" : { "type" : "none" , "size" : 20, "link" : "none", "html" : "true" },
32 "_photolist" : { "type" : "none" , "size" : 20, "link" : "none", "html" : "true" },
33 "_avatar" : { "type" : "none" , "size" : 20, "link" : "none", "html" : "true" }
34 })
35 ## id of the div, list of columns, columns properties, default column to sort for, class name, number of entries, display a tag cloud
36 ## protect with pre
37 #grid("users" $collist $colprops "last_name" "asc" "user_" "XWiki.XWikiUsers" 4 true)
38 ## protect with /pre
39 {code}
40
41 1.1.1 Result
42
43 #includeMacros("XWiki.GridExtensionMacros")
44 ## optional GWT prop editor
45 #gwtpropeditor()
46 #set($collist = ["_avatar", "first_name", "last_name", "email" ])
47 #set($colprops = {
48 "first_name" : { "type" : "text" , "size" : 10, "link" : "view"},
49 "last_name" : { "type" : "text" , "size" : 10, "link" : "view"},
50 "imtype" : { "type" : "list" , "size" : 1, "link" : "none"},
51 "email" : { "type" : "text" , "size" : 20, "link" : "editor"},
52 "doc.creator" : { "type" : "text" , "size" : 20, "link" : "none"},
53 "_attachment" : { "type" : "none" , "size" : 20, "link" : "none", "html" : "true" },
54 "_photolist" : { "type" : "none" , "size" : 20, "link" : "none", "html" : "true" },
55 "_avatar" : { "type" : "none" , "size" : 20, "link" : "none", "html" : "true" }
56 })
57 ## id of the div, list of columns, columns properties, default column to sort for, class name
58 {pre}
59 #grid("users" $collist $colprops "last_name" "asc" "user_" "XWiki.XWikiUsers" 4 false)
60 {/pre}
61 #end