[#133] Custom reports respect sorting in SQL
This commit is contained in:
		| @@ -9,6 +9,7 @@ | ||||
|   * [#162] Change from Net::MAC to NetAddr::MAC | ||||
|   * [#159] Macsuck archive behaviour same as ND1 (unseen nodes remain active) | ||||
|   * [#170] Show device SNMP::Info class in web interface | ||||
|   * [#133] Custom reports respect sorting in SQL | ||||
|   * Add "Run Expire Job" to the Admin Menu | ||||
|  | ||||
|   [BUG FIXES] | ||||
|   | ||||
| @@ -55,6 +55,7 @@ foreach my $report (@{setting('reports')}) { | ||||
|       if (request->is_ajax) { | ||||
|           template 'ajax/report/generic_report.tt', | ||||
|               { results => \@results, | ||||
|                 is_custom_report => true, | ||||
|                 headings => [map {values %{$_}} @{$report->{columns}}], | ||||
|                 columns => [map {keys %{$_}} @{$report->{columns}}] }, | ||||
|               { layout => undef }; | ||||
|   | ||||
| @@ -8,4 +8,14 @@ | ||||
|       "search": '_INPUT_', | ||||
|       "searchPlaceholder": 'Filter records...', | ||||
|       "lengthMenu": "Show _MENU_ records." | ||||
|     }, | ||||
|     "stateSaveParams": function (settings, data) { | ||||
|       // make sure filter is never saved | ||||
|       data.search.search = ""; | ||||
|       // make sure paging position is not saved | ||||
|       data.start = 0; | ||||
|       [% IF is_custom_report %] | ||||
|       // disable sorting for custom reports | ||||
|       data.order = ""; | ||||
|       [% END %] | ||||
|     } | ||||
|   | ||||
| @@ -20,6 +20,7 @@ | ||||
| <script> | ||||
| $(document).ready(function() { | ||||
|   $('#rg-data-table').dataTable({ | ||||
|     "order": [], | ||||
| [% INCLUDE 'ajax/datatabledefaults.tt' -%] | ||||
|   } ); | ||||
| } ); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user