diff options
author | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-08-22 23:37:43 +0400 |
---|---|---|
committer | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-08-22 23:37:43 +0400 |
commit | 9e56138f792d95a7b822e23492e8a340eebe7423 (patch) | |
tree | 76e396063338f07b2162ba8eddb2ec6ea4e9c8eb /plugins | |
parent | 8bb5f175d7f4a0e960b7251823dcbd3961a5e001 (diff) |
Refs #4041, allow all view/visualization properties to be set via query parameter, remove unecessary client side properties from ViewDataTable, move HtmlTable specific client side parameters to HtmlTable, remove code that looks for generic filter query parameters when setting client side parameters, make sure client side parameters are set if they're not false (ie, 0) instead of if not empty and add filter_offset as view property.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CoreHome/javascripts/dataTable.js | 6 | ||||
-rw-r--r-- | plugins/CoreHome/templates/_dataTable.twig | 4 | ||||
-rw-r--r-- | plugins/CoreVisualizations/Visualizations/HtmlTable.php | 6 |
3 files changed, 11 insertions, 5 deletions
diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js index 6831a6a215..9483c52277 100644 --- a/plugins/CoreHome/javascripts/dataTable.js +++ b/plugins/CoreHome/javascripts/dataTable.js @@ -350,7 +350,7 @@ dataTable.prototype = return imageSortSrc; } - if (self.param.enable_sort) { + if (self.props.enable_sort) { $('.sortable', domElem).off('click.dataTableSort').on('click.dataTableSort', function () { $(this).off('click.dataTableSort'); @@ -364,7 +364,9 @@ dataTable.prototype = var imageSortSrc = getSortImageSrc(); var imageSortWidth = 16; var imageSortHeight = 16; - var ImageSortClass = self.param.filter_sort_order.charAt(0).toUpperCase() + self.param.filter_sort_order.substr(1); + + var sortOrder = self.param.filter_sort_order; + var ImageSortClass = sortOrder.charAt(0).toUpperCase() + sortOrder.substr(1); // we change the style of the column currently used as sort column // adding an image and the class columnSorted to the TD diff --git a/plugins/CoreHome/templates/_dataTable.twig b/plugins/CoreHome/templates/_dataTable.twig index 5b04fdf9f7..0d72843fbe 100644 --- a/plugins/CoreHome/templates/_dataTable.twig +++ b/plugins/CoreHome/templates/_dataTable.twig @@ -3,8 +3,8 @@ <div class="dataTable {{ visualizationCssClass }} {{ properties.datatable_css_class|default('') }} {% if isSubtable %}subDataTable{% endif %}" data-table-type="{{ properties.datatable_js_type|default('dataTable') }}" data-report="{{ properties.report_id }}" - data-props="{{ clientSidePropertiesToSet|json_encode }}" - data-params="{{ javascriptVariablesToSet|json_encode }}"> + data-props="{% if clientSidePropertiesToSet is empty %}{}{% else %}{{ clientSidePropertiesToSet|json_encode }}{% endif %}" + data-params="{% if javascriptVariablesToSet is empty %}{}{% else %}{{ javascriptVariablesToSet|json_encode }}{% endif %}"> <div class="reportDocumentation"> {% if properties.documentation|default is not empty %}<p>{{ properties.documentation|raw }}</p>{% endif %} {% if properties.metadata.archived_date is defined %}<span class='helpDate'>{{ properties.metadata.archived_date }}</span>{% endif %} diff --git a/plugins/CoreVisualizations/Visualizations/HtmlTable.php b/plugins/CoreVisualizations/Visualizations/HtmlTable.php index e7c86e6b05..64b2012e7f 100644 --- a/plugins/CoreVisualizations/Visualizations/HtmlTable.php +++ b/plugins/CoreVisualizations/Visualizations/HtmlTable.php @@ -88,6 +88,7 @@ class HtmlTable extends DataTableVisualization static public $clientSideParameters = array( 'search_recursive', 'filter_limit', + 'filter_offset', 'filter_sort_column', 'filter_sort_order', ); @@ -96,7 +97,10 @@ class HtmlTable extends DataTableVisualization 'show_extra_columns', 'show_goals_columns', 'disable_row_evolution', - 'disable_row_actions' + 'disable_row_actions', + 'enable_sort', + 'keep_summary_row', + 'subtable_controller_action', ); /** |