Hello,
Too late but could help someone else.
I did the following (without empty line in table definition):
{{velocity}}
$xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js")
$xwiki.ssfx.use("js/xwiki/table/table.css")
{{/velocity}}
(% class="grid sortable filterable doOddEven" id="customerList" %)
(% class="sortHeader" %)|=(% style="width:114px" %)Column1|=(%
style="width:114px" %)Column2|=(% style="width:114px" %)Column3|=(%
style="width:28px" %)Column4|=(% class="unsortable" %)Column5
|data1.1|data1.2|data1.3|data1.4|data1.5
|data2.1|data2.2|data2.3|data2.4|data2.5
Yes, that is static table, that feed my need, but you could replace it
by your velocity code
Note the following about (% ... %)
- 1st one alone on one line just before table set class on <table>
- 1st one as begin of 1st table's row set class on <tr>
- other on this 1st row set style on <td>
- for column 5, I set it un-sortable, in my use case that is a comment column
Regards,
Arnaud.
2012/9/11 Haimerl, Josef <Josef.Haimerl(a)de-gmbh.com>om>:
Found a solution for my needs:
$xwiki.ssfx.use("js/xwiki/table/table.css")
$xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
<table id="tableid" class="sortable filterable doOddEven
xwikidatatable" cellpadding="0" cellspacing="0"
border="0" nowrap>
<colgroup>
<col width="100">
<col width="100">
<col width="100">
<col width="100">
<col width="100">
<col width="28">
</colgroup>
<tr class="sortHeader">
<th> </th>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
</tr>
#set($query=" ")
#set($results=$xwiki.search($query))
#foreach($docname in $results)
#if($xwiki.hasAccessLevel("view",$context.user,$docname))
#set($rdoc=$xwiki.getDocument($docname).getTranslatedDocument())
#set($deletedoc=$xwiki.getURL($docname,'delete'))
#set ($host = ${request.getRequestURL()})
#set ($host = ${host.substring(0,
${host.indexOf('/',${mathtool.add(${host.indexOf('//')}, 2)})})})
<tr>
<td>$rdoc.get()</td>
<td>$rdoc.title</td>
<td>$rdoc.get()</td>
<td>$rdoc.get()</td>
<td>$rdoc.get()</td>
<td><img
src="/industrialwiki/resources/icons/silk/bin_closed.png"></td>
</tr>
#end
#end
</table>
-----Ursprüngliche Nachricht-----
Von: users-bounces(a)xwiki.org [mailto:users-bounces@xwiki.org] Im
Auftrag von Haimerl, Josef
Gesendet: Dienstag, 11. September 2012 15:05
An: users(a)xwiki.org
Betreff: [xwiki-users] tablefilterNsort.js
Hello,
i'm using (% id="tableid" class="sortable filterable doOddEven
xwikidatatable")(% class="sortHeader" %) to create a dynamic sortable
table. Tried a lot with css modifications to set a fixed table-layout,
but i did not get that far.
In my despair also tried following code, but then the filter function
disappears.
(% id="tableid" class="sortable filterable doOddEven xwikidatatable"
%)
(% class="sortHeader" style="width:100%"%)|= Column1|= Column2|=
Column3|= Column4|= Column5
{{html clean="false" wiki="true"}}<col
style="width:114px"><col
style="width:114px"><col style="width:114px"><col
style="width:114px"><col style="width:114px"><col
style="width:28px">{{/html}}
Anybody any hints?
Many thanks in advance! Regards,
Josef Haimerl
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users