Skip to content

Commit

Permalink
Remove datatables-columns.type as we do not need it anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair3149 committed Nov 23, 2024
1 parent 19ee98f commit 5133a68
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
2 changes: 1 addition & 1 deletion formats/datatables/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function execute() {
if ( $hasMainlabel && trim( $parameters['mainlabel'] ) === '-' ) {
continue;
}
// match something like |?=abc |+ datatables-columns.type=number |+template=mytemplate
// match something like |?=abc |+template=mytemplate
}

// create printrequest from request mode, label, property name, output format, parameters
Expand Down
10 changes: 0 additions & 10 deletions formats/datatables/DataTables.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,16 +267,6 @@ public function getParamDefinitions( array $definitions ) {

//////////////// datatables columns

// only the options whose value has a sense to
// use for all columns, otherwise use (for single printouts)
// |?printout name |+ datatables-columns.type = string

$params['datatables-columns.type'] = [
'type' => 'string',
'message' => 'srf-paramdesc-datatables-library-option',
'default' => '',
];

$params['datatables-columns.width'] = [
'type' => 'string',
'message' => 'srf-paramdesc-datatables-library-option',
Expand Down
10 changes: 3 additions & 7 deletions formats/datatables/resources/ext.srf.formats.datatables.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,13 +577,9 @@

var columnDefs = [];
$.map(printrequests, function (property, index) {
// @see https://datatables.net/reference/option/columns.type
// value for all columns
if (!options.columns.type) {
var isNumeric = ( entityCollation === 'numeric' && property.typeid === '_wpg' )
|| [ '_num', '_tem', '_qty' ].indexOf(property.typeid) !== -1;
options.columns.type = isNumeric ? 'num' : null;
}
var isNumeric = ( entityCollation === 'numeric' && property.typeid === '_wpg' )
|| [ '_num', '_tem', '_qty' ].indexOf(property.typeid) !== -1;
options.columns.type = isNumeric ? 'num' : 'string';

columnDefs.push(
$.extend(
Expand Down
2 changes: 1 addition & 1 deletion tests/qunit/formats/ext.srf.formats.datatables.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5133a68

Please sign in to comment.