Index: src/main/webapp/resources/js/xwiki/table/livetable.js =================================================================== --- src/main/webapp/resources/js/xwiki/table/livetable.js (revision 28512) +++ src/main/webapp/resources/js/xwiki/table/livetable.js (working copy) @@ -54,8 +54,11 @@ // fallback on the unique "display1" id for backward compatibility. this.displayNode = $(domNodeName + "-display") || $('display1'); - // Node under which all forms controls (input, selects, etc.) will be filters for this table - this.filtersNode = options.filtersNode || $(domNodeName).up("div.xwiki-livetable-container") || $(domNodeName).down(".xwiki-livetable-display-filters"); + // Nodes under which all forms controls (input, selects, etc.) will be filters for this table + this.filtersNodes = []; + this.filtersNodes.push(options.filterNode || $(domNodeName).down(".xwiki-livetable-display-filters")); + this.filtersNodes.push(options.additionalFilters); // can be a dom node or an array of dom nodes + this.filtersNodes = this.filtersNodes.flatten().compact(); // Array of nodes under which pagination for this livetable will be displayed. this.paginationNodes = options.paginationNodes || $(this.domNodeName).select(".xwiki-livetable-pagination"); @@ -74,10 +77,10 @@ this.paginator = new LiveTablePagination(this, this.paginationNodes, options.maxPages || 10); } // Initialize filters - if (this.filtersNode) { + if (this.filtersNodes.length > 0) { var initialFilters = this.permalinks ? this.getFiltersFromHash() : new Object(); - this.filter = new LiveTableFilter(this, this.filtersNode, initialFilters); - } + this.filter = new LiveTableFilter(this, this.filtersNodes, initialFilters); + } if ($(domNodeName + "-tagcloud")) { @@ -574,10 +577,10 @@ * The class that deals with the filtering in a table */ var LiveTableFilter = Class.create({ - initialize: function(table, filterNode, filters) + initialize: function(table, filterNodes, filters) { this.table = table; - this.filterNode = $(filterNode); + this.filterNodes = filterNodes; this.filters = new Object(); this.filters = filters; @@ -599,7 +602,8 @@ */ initializeFilters: function() { - var inputs = this.filterNode.select("input"); + var inputs = this.filterNodes.invoke('select','input').flatten(); +console.log(inputs); for (var i = 0; i < inputs.length; ++i) { var key = inputs[i].name; if ((inputs[i].type == "radio") || (inputs[i].type == "checkbox")) { @@ -617,7 +621,7 @@ } } - var selects = this.filterNode.select("select"); + var selects = this.filterNodes.invoke('select','select').flatten(); for (var i = 0; i < selects.length; ++i) { if (!this.filters[selects[i].name]) { continue; @@ -639,10 +643,10 @@ // Then we can write : // return Form.serializeElements(Form.getElements(this.domNodeName); var result = ""; - var filters = this.filterNode.select("input", "select"); + var filters = this.filterNodes.invoke('select','input','select').flatten(); for (var i=0;i