Last modified by Drunk Monkey on 2023-04-26 18:21

From version 4.1
edited by Drunk Monkey
on 2022-02-14 06:02
Change comment: Install extension [clemensrobbenhaar:make-all-wiki-tables-sortable-macro/0.3]
To version 1.1
edited by Drunk Monkey
on 2020-04-11 16:36
Change comment: Install extension [clemensrobbenhaar:make-all-wiki-tables-sortable-macro/0.1]

Summary

Details

XWiki.JavaScriptExtension[0]
Caching policy
... ... @@ -1,1 +1,1 @@
1 -long
1 +forbid
Code
... ... @@ -10,18 +10,10 @@
10 10   }
11 11   }
12 12  
13 - var findSortHeadRow = function(table) {
14 - var thCell = table.descendants();
15 - thCell[0].children.item(0).addClassName('sortHeader');
16 - }
17 -
18 18   $$("#xwikicontent table").each(function(table) {
19 - if (table.getAttribute('class') !== null && table.getAttribute('class').indexOf('xwiki-livetable') >= 0) {
20 - // ignore livetables; they take care of themselves
21 - return;
22 - }
23 23   tableCounter++;
24 24   if (macro_sortabletables_sortable) {
16 + tableCounter++;
25 25   table.addClassName('grid')
26 26   table.addClassName('sortable')
27 27   table.addClassName('doOddEven');
... ... @@ -29,7 +29,6 @@
29 29   table.setAttribute('id', tableIdPrefix + tableCounter);
30 30   }
31 31   findSortHeader(table);
32 - findSortHeadRow(table);
33 33   // we do not need to call this, as we are (hopefully) before window.load
34 34   //ts_makeSortable(table);
35 35   }
... ... @@ -41,8 +41,8 @@
41 41   table.setAttribute('id', tableIdPrefix + tableCounter);
42 42   }
43 43   findSortHeader(table);
44 - findSortHeadRow(table);
45 45   }
36 + // setFilterGrid(table.getAttribute('id'), (getHeaderRow(table)) );
46 46   }
47 47   })
48 48  });
XWiki.StyleSheetExtension[0]
Caching policy
... ... @@ -1,1 +1,0 @@
1 -long
Code
... ... @@ -1,8 +1,0 @@
1 -#xwikicontent{
2 - overflow: unset;
3 -}
4 -.sortHeader{
5 - position: -webkit-sticky;
6 - position: sticky;
7 - top:0;
8 -}
XWiki.WikiMacroClass[0]
Cached
... ... @@ -1,1 +1,0 @@
1 -No
Asynchronous rendering
... ... @@ -1,1 +1,0 @@
1 -No
Macro code
... ... @@ -1,10 +1,7 @@
1 1  {{velocity output="false"}}
2 2  $xwiki.ssfx.use("js/xwiki/table/table.css")
3 3  $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
4 -$xwiki.jsx.use("Macros.SortableTables", {'minify': true, "defer": false})
5 -#if($xcontext.macro.params.sticky=="yes")
6 - $xwiki.ssx.use("Macros.SortableTables")
7 -#end
4 +$xwiki.jsx.use("Macros.SortableTables", {'minify': true})
8 8  {{/velocity}}{{velocity}}{{html clean="false"}}
9 9  <script type="text/javascript">
10 10  var macro_sortabletables_sortable = #if($xcontext.macro.params.sortable=="yes")true#{else}false#{end};
XWiki.WikiMacroParameterClass[2]
Parameter default value
... ... @@ -1,1 +1,0 @@
1 -no
Parameter description
... ... @@ -1,1 +1,0 @@
1 -set to "yes", if the tables header should stick to the top of the screen when scrolling on a long table
Parameter mandatory
... ... @@ -1,1 +1,0 @@
1 -No
Parameter name
... ... @@ -1,1 +1,0 @@
1 -sticky