commit
41ef37f7ed
@ -0,0 +1,3 @@
|
|||||||
|
Please post support requests and questions in the DataTables forums at https://datatables.net/forums. Support requests posted here will be closed. The intention of this request is to allow all questions to be located in a single, searchable, location.
|
||||||
|
|
||||||
|
When you post your question in the DataTables forums, please ensure that you include a link to the page showing the issue so it can be debugged.
|
@ -0,0 +1,141 @@
|
|||||||
|
/**
|
||||||
|
* This data rendering helper method can be useful when a hyperLink with custom
|
||||||
|
* anchorText has to rendered. The data for the column is still fully searchable and sortable, based on the hyperLink value,
|
||||||
|
* and sortable, based on the hyperLink value, but during display in webpage is rendered with custom placeholder
|
||||||
|
*
|
||||||
|
* It accepts four parameters:
|
||||||
|
*
|
||||||
|
* 1. 'anchorText' - type string - (optional - default `Click Here`) - The custom placeholder to display
|
||||||
|
* 2. 'location' - type string - (optional - default `newTab`)
|
||||||
|
* takes two values 'newTab' and 'popup'
|
||||||
|
* 3. 'width' - type integer - (optional - default `600`)
|
||||||
|
* The custom width of popup to display.
|
||||||
|
* Value is utilised on when 'location' is given as 'popup'.
|
||||||
|
* 4. 'height' - type integer - (optional - default `400`)
|
||||||
|
* The custom heigth of popup to display.
|
||||||
|
* Value is utilised on when 'location' is given as 'popup'.
|
||||||
|
*
|
||||||
|
* @name hyperLink
|
||||||
|
* @summary Displays url data in hyperLink with custom plcaeholder
|
||||||
|
* @author [Lokesh Babu]
|
||||||
|
* @requires DataTables 1.10+
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* // Display the hyperlink with 'Click Here', which open hyperlink in new Tab or new Window based on Browser setting
|
||||||
|
* $('#example').DataTable( {
|
||||||
|
* columnDefs: [ {
|
||||||
|
* targets: 1,
|
||||||
|
* render: $.fn.dataTable.render.hyperLink()
|
||||||
|
* } ]
|
||||||
|
* } );
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* // Display the hyperlink with 'Download', which open hyperlink in new Tab or new Window based on Browser setting
|
||||||
|
* $('#example').DataTable( {
|
||||||
|
* columnDefs: [ {
|
||||||
|
* targets: 2,
|
||||||
|
* render: $.fn.dataTable.render.hyperLink( 'Download' )
|
||||||
|
* } ]
|
||||||
|
* } );
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* // Display the hyperlink with 'Download', which open hyperlink in popup
|
||||||
|
* // with size 600as width and 400 as height
|
||||||
|
* $('#example').DataTable( {
|
||||||
|
* columnDefs: [ {
|
||||||
|
* targets: 2,
|
||||||
|
* render: $.fn.dataTable.render.hyperLink( 'Download', 'popup' )
|
||||||
|
* } ]
|
||||||
|
* } );
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* // Display the hyperlink with 'Download', which open hyperlink in popup
|
||||||
|
* // with size 1000 width and 500 as height
|
||||||
|
* $('#example').DataTable( {
|
||||||
|
* columnDefs: [ {
|
||||||
|
* targets: 2,
|
||||||
|
* render: $.fn.dataTable.render.hyperLink( 'Download', 'popup' , 1000, 500)
|
||||||
|
* } ]
|
||||||
|
* } );
|
||||||
|
*/
|
||||||
|
|
||||||
|
jQuery.fn.dataTable.render.hyperLink = function (
|
||||||
|
anchorText,
|
||||||
|
location,
|
||||||
|
width,
|
||||||
|
height
|
||||||
|
) {
|
||||||
|
validateAndReturnDefaultIfFailed = function (item, defaultValue) {
|
||||||
|
if (typeof item === "number") {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof item === "string") {
|
||||||
|
return parseInt(item) ? item : defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return defaultValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
var anchorText = anchorText || "Click Here";
|
||||||
|
var location = location || "newTab";
|
||||||
|
var width = validateAndReturnDefaultIfFailed(width, "600");
|
||||||
|
var height = validateAndReturnDefaultIfFailed(height, "400");
|
||||||
|
|
||||||
|
return function (data, type, row) {
|
||||||
|
// restriction only for table display rendering
|
||||||
|
if (type !== "display") {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
var url = data;
|
||||||
|
|
||||||
|
try {
|
||||||
|
url = new URL(data);
|
||||||
|
|
||||||
|
switch (location) {
|
||||||
|
case "newTab":
|
||||||
|
return (
|
||||||
|
'<a title="' +
|
||||||
|
url +
|
||||||
|
'" href="' +
|
||||||
|
url +
|
||||||
|
'" target="_blank">' +
|
||||||
|
anchorText +
|
||||||
|
"</a>"
|
||||||
|
);
|
||||||
|
case "popup":
|
||||||
|
return (
|
||||||
|
'<a title="' +
|
||||||
|
url +
|
||||||
|
'" href="' +
|
||||||
|
url +
|
||||||
|
'" target="popup" rel="noopener noreferrer" onclick="window.open(\'' +
|
||||||
|
url +
|
||||||
|
"', '" +
|
||||||
|
anchorText +
|
||||||
|
"', 'width=" +
|
||||||
|
width +
|
||||||
|
",height=" +
|
||||||
|
height +
|
||||||
|
"'); return false;\">" +
|
||||||
|
anchorText +
|
||||||
|
"</a>"
|
||||||
|
);
|
||||||
|
default:
|
||||||
|
return (
|
||||||
|
'<a title="' +
|
||||||
|
url +
|
||||||
|
'" href="' +
|
||||||
|
url +
|
||||||
|
'" target="_blank">' +
|
||||||
|
anchorText +
|
||||||
|
"</a>"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
@ -0,0 +1,109 @@
|
|||||||
|
/**
|
||||||
|
* @summary ConditionalPageLength
|
||||||
|
* @description Hide the page length control when the amount of pages is <= 1
|
||||||
|
* @version 1.0.0
|
||||||
|
* @file dataTables.conditionalPageLength.js
|
||||||
|
* @author Garrett Hyder (https://github.com/garretthyder)
|
||||||
|
* @contact garrett.m.hyder@gmail.com
|
||||||
|
* @copyright Copyright 2020 Garrett Hyder
|
||||||
|
*
|
||||||
|
* License MIT - http://datatables.net/license/mit
|
||||||
|
*
|
||||||
|
* This feature plugin for DataTables hides the page length control when the amount
|
||||||
|
* of pages is <= 1. The control can either appear / disappear or fade in / out.
|
||||||
|
*
|
||||||
|
* Based off conditionalPaging by Matthew Hasbach (https://github.com/mjhasbach)
|
||||||
|
* Reference: https://github.com/DataTables/Plugins/blob/master/features/conditionalPaging/dataTables.conditionalPaging.js
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* $('#myTable').DataTable({
|
||||||
|
* conditionalPageLength: true
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* $('#myTable').DataTable({
|
||||||
|
* conditionalPageLength: {
|
||||||
|
* style: 'fade',
|
||||||
|
* speed: 500 // optional
|
||||||
|
* }
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* Conditionally hide the Page Length options that are less than the current result size.
|
||||||
|
* @example
|
||||||
|
* $('#myTable').DataTable({
|
||||||
|
* conditionalPageLength: {
|
||||||
|
* conditionalOptions: true
|
||||||
|
* }
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function(window, document, $) {
|
||||||
|
$(document).on('init.dt', function(e, dtSettings) {
|
||||||
|
if ( e.namespace !== 'dt' ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var options = dtSettings.oInit.conditionalPageLength || $.fn.dataTable.defaults.conditionalPageLength,
|
||||||
|
lengthMenu = dtSettings.aLengthMenu || $.fn.dataTable.defaults.lengthMenu,
|
||||||
|
lengthMenuValues = Array.isArray(lengthMenu[0]) ? lengthMenu[0] : lengthMenu;
|
||||||
|
|
||||||
|
lengthMenuValues = lengthMenuValues.filter(function(n) { return n > 0 });
|
||||||
|
var smallestLength = Math.min.apply(Math, lengthMenuValues);
|
||||||
|
|
||||||
|
if ($.isPlainObject(options) || options === true) {
|
||||||
|
var config = $.isPlainObject(options) ? options : {},
|
||||||
|
api = new $.fn.dataTable.Api(dtSettings),
|
||||||
|
speed = 'slow',
|
||||||
|
conditionalPageLength = function(e) {
|
||||||
|
var $paging = $(api.table().container()).find('div.dataTables_length'),
|
||||||
|
pages = api.page.info().pages,
|
||||||
|
size = api.rows({search:'applied'}).count();
|
||||||
|
|
||||||
|
if (e instanceof $.Event) {
|
||||||
|
if (pages <= 1 && size <= smallestLength) {
|
||||||
|
if (config.style === 'fade') {
|
||||||
|
$paging.stop().fadeTo(speed, 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$paging.css('visibility', 'hidden');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (config.style === 'fade') {
|
||||||
|
$paging.stop().fadeTo(speed, 1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$paging.css('visibility', '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (pages <= 1 && size <= smallestLength) {
|
||||||
|
if (config.style === 'fade') {
|
||||||
|
$paging.css('opacity', 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$paging.css('visibility', 'hidden');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.conditionalOptions) {
|
||||||
|
$paging.find('select option').each(function(index) {
|
||||||
|
if ($(this).attr('value') > size) {
|
||||||
|
$(this).hide();
|
||||||
|
} else {
|
||||||
|
$(this).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if ( config.speed !== undefined ) {
|
||||||
|
speed = config.speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
conditionalPageLength();
|
||||||
|
|
||||||
|
api.on('draw.dt', conditionalPageLength);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})(window, document, jQuery);
|
@ -0,0 +1,30 @@
|
|||||||
|
/**
|
||||||
|
* Kannada translation
|
||||||
|
* @name Kannada
|
||||||
|
* @anchor Kannada
|
||||||
|
* @author Rakesh Gattapur
|
||||||
|
* @lcid kn
|
||||||
|
*/
|
||||||
|
|
||||||
|
{
|
||||||
|
"sEmptyTable": "ಕೋಷ್ಟಕದಲ್ಲಿ ಯಾವುದೇ ಡೇಟಾ ಲಭ್ಯವಿಲ್ಲ",
|
||||||
|
"sInfo": "ಒಟ್ಟು _TOTAL_ ಎಂಟ್ರಿಗಳಲ್ಲಿ _START_ ರಿಂದ _END_ ವರೆಗು ತೋರಿಸಲಾಗುತ್ತಿದೆ",
|
||||||
|
"sInfoEmpty": "ಒಟ್ಟು 0 ಎಂಟ್ರಿಗಳಲ್ಲಿ 0 ರಿಂದ 0 ವರೆಗು ತೋರಿಸಲಾಗುತ್ತಿದೆ",
|
||||||
|
"sInfoFiltered": "(ಒಟ್ಟು _MAX_ ಎಂಟ್ರಿ ಗಳಿಂದ ಫಿಲ್ಟರ್ ಮಾಡಲಾಗಿದೆ)",
|
||||||
|
"sInfoThousands": ",",
|
||||||
|
"sLengthMenu": "_MENU_ ಎಂಟ್ರಿಗಳು ತೋರಿಸು",
|
||||||
|
"sLoadingRecords": "ಲೋಡ್ ಆಗುತ್ತಿದೆ...",
|
||||||
|
"sProcessing": "ಸಂಸ್ಕರಿಸಲಾಗುತ್ತಿದೆ...",
|
||||||
|
"sSearch": "ಹುಡುಕಿ:",
|
||||||
|
"sZeroRecords": "ಯಾವುದೇ ಹೊಂದಾಣಿಕೆಯ ದಾಖಲೆಗಳು ಇಲ್ಲ",
|
||||||
|
"oPaginate": {
|
||||||
|
"sFirst": "ಪ್ರಥಮ",
|
||||||
|
"sLast": "ಅಂತಿಮ",
|
||||||
|
"sNext": "ಮುಂದಿನದು",
|
||||||
|
"sPrevious": "ಹಿಂದಿನದು"
|
||||||
|
},
|
||||||
|
"oAria": {
|
||||||
|
"sSortAscending": ": ಕಾಲಂ ಅನ್ನು ಆರೋಹಣವಾಗಿ ವಿಂಗಡಿಸಲು ಸಕ್ರಿಯಗೊಳಿಸಿ",
|
||||||
|
"sSortDescending": ": ಕಾಲಂ ಅನ್ನು ಅವರೋಹಣವಾಗಿ ವಿಂಗಡಿಸಲು ಸಕ್ರಿಯಗೊಳಿಸಿ"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
/**
|
||||||
|
* Punjabi translation ( pa, pa-Guru, pa-IN )
|
||||||
|
* @name Punjabi
|
||||||
|
* @anchor Punjabi
|
||||||
|
* @author <a href="http://ijagjeet.com/">Jagjeet Singh</a>
|
||||||
|
* @lcid pa
|
||||||
|
*/
|
||||||
|
|
||||||
|
{
|
||||||
|
"sEmptyTable": "ਸੂਚੀ ਵਿੱਚ ਕੋਈ ਕਤਾਰ ਉਪਲਬਧ ਨਹੀਂ ਹੈ",
|
||||||
|
"sInfo": "_TOTAL_ ਵਿੱਚੋਂ _START_ ਤੋਂ _END_ ਐਂਟਰੀਆਂ ਦਿੱਖ ਰਹੀਆਂ ਹਨ",
|
||||||
|
"sInfoEmpty": "0 ਵਿੱਚੋਂ 0 ਤੋਂ 0 ਕਤਾਰਾਂ ਦਿੱਖ ਰਹੀਆਂ ਹਨ",
|
||||||
|
"sInfoFiltered": "(ਕੁੱਲ _MAX_ ਵਿਚੋਂ ਛਾਂਟੀਆਂ ਗਈਆਂ ਕਤਾਰਾਂ)",
|
||||||
|
"sInfoThousands": ",",
|
||||||
|
"sLengthMenu": "ਕੁੱਲ _MENU_ ਕਤਾਰਾਂ",
|
||||||
|
"sLoadingRecords": "ਸੂਚੀ ਲੋਡ ਹੋ ਰਹੀ ਹੈ...",
|
||||||
|
"sProcessing": "ਕਾਰਵਾਈ ਚੱਲ ਰਹੀ ਹੈ...",
|
||||||
|
"sSearch": "ਖੋਜ ਕਰੋ:",
|
||||||
|
"sZeroRecords": "ਕੋਈ ਕਤਾਰ ਨਹੀਂ ਮਿਲੀ",
|
||||||
|
"oPaginate": {
|
||||||
|
"sFirst": "ਪਹਿਲਾ",
|
||||||
|
"sLast": "ਅਖੀਰਲਾ",
|
||||||
|
"sNext": "ਅਗਲਾ",
|
||||||
|
"sPrevious": "ਪਿਛਲਾ"
|
||||||
|
},
|
||||||
|
"oAria": {
|
||||||
|
"sSortAscending": ": ਕਾਲਮ ਨੂੰ ਵੱਧਦੇ ਕ੍ਰਮ ਵਿਚ ਵੇਖੋ",
|
||||||
|
"sSortDescending": ": ਕਾਲਮ ਨੂੰ ਘਟਦੇ ਕ੍ਰਮ ਵਿਚ ਵੇਖੋ"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
/**
|
||||||
|
* Rumantsch translation
|
||||||
|
* @name Rumantsch
|
||||||
|
* @anchor Rumantsch
|
||||||
|
* @author ULR Uniun Littaratura Rumantscha https://litteraturarumantscha.ch
|
||||||
|
* @author translation: Benedetto Vigne
|
||||||
|
* @author language pack: Christian Spescha
|
||||||
|
* @lcid rm
|
||||||
|
*/
|
||||||
|
|
||||||
|
{
|
||||||
|
"sEmptyTable": "Naginas endataziuns",
|
||||||
|
"sInfo": "_START_ fin _END_ da _TOTAL_ endataziuns",
|
||||||
|
"sInfoEmpty": "Naginas endataziuns",
|
||||||
|
"sInfoFiltered": "(filtrà da _MAX_ endataziuns)",
|
||||||
|
"sInfoThousands": ".",
|
||||||
|
"sLengthMenu": "_MENU_ Dumber da cumparsas",
|
||||||
|
"sLoadingRecords": "vegn chargià ..",
|
||||||
|
"sProcessing": "Spetgar p.pl...",
|
||||||
|
"sSearch": "Tschertga",
|
||||||
|
"sZeroRecords": "Naginas endataziuns.",
|
||||||
|
"oPaginate": {
|
||||||
|
"sFirst": "Emprima",
|
||||||
|
"sPrevious": "Anavos",
|
||||||
|
"sNext": "Proxima",
|
||||||
|
"sLast": "Ultima"
|
||||||
|
},
|
||||||
|
"oAria": {
|
||||||
|
"sSortAscending": ": activar per zavrar las colonnas ensi",
|
||||||
|
"sSortDescending": ": activar per zavrar las colonnas engiu"
|
||||||
|
},
|
||||||
|
"select": {
|
||||||
|
"rows": {
|
||||||
|
"_": "%d lingias selecziunadas",
|
||||||
|
"1": "1 lingia selecziunada"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"buttons": {
|
||||||
|
"print": "Stampar",
|
||||||
|
"colvis": "Colonnas",
|
||||||
|
"copy": "Copiar",
|
||||||
|
"copyTitle": "Copiar en l'archiv provisoric",
|
||||||
|
"copyKeys": "Tasta <i>ctrl</i> u <i>\u2318</i> + <i>C</i> per copiar<br>la tabella en l'arcun provisoric.<br><br>Per interrumper cliccar il messadi u smatgar Escape",
|
||||||
|
"copySuccess": {
|
||||||
|
"_": "%d lingias copiadas",
|
||||||
|
"1": "1 lingia copiada"
|
||||||
|
},
|
||||||
|
"pageLength": {
|
||||||
|
"-1": "Mussar tut las lingias",
|
||||||
|
"_": "Mussar %d lingias"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* Read information from a column of input (type number) elements and return an
|
||||||
|
* array to use as a basis for sorting.
|
||||||
|
*
|
||||||
|
* @summary Sorting based on the values of `dt-tag input` elements in a column.
|
||||||
|
* @name Input element data source
|
||||||
|
* @requires DataTables 1.10+
|
||||||
|
* @author [Allan Jardine](http://sprymedia.co.uk)
|
||||||
|
*/
|
||||||
|
|
||||||
|
$.fn.dataTable.ext.order['dom-text-numeric'] = function ( settings, col )
|
||||||
|
{
|
||||||
|
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
||||||
|
return $('input', td).val() * 1;
|
||||||
|
} );
|
||||||
|
}
|
@ -0,0 +1,113 @@
|
|||||||
|
/**
|
||||||
|
* When sorting values in a DataTable you might want to sort any 'novalue'
|
||||||
|
* pattern as max or min value in a column (e.g. '-' treat as -1000 or 1000).
|
||||||
|
*
|
||||||
|
* This is very useful if You want to sort incomplete data, there is no
|
||||||
|
* data available for each entry in a column (e.g. Recovered for covid-19).
|
||||||
|
*
|
||||||
|
* If You do not have data, You can set the 'novalue' pattern to '-' or
|
||||||
|
* any other pattern and set exact column to treat this 'novalue' pattern
|
||||||
|
* as the max value (sethigh) or the min value (setlow).
|
||||||
|
*
|
||||||
|
* @name novalue.js
|
||||||
|
* @summary Sort any "novalue" pattern as max or min (e.g. '-' treat as -1000 or 1000).
|
||||||
|
* @author Darek L https://github.com/dprojects
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* gTable = $('#covid-table').DataTable({
|
||||||
|
* "orderClasses": true,
|
||||||
|
* "responsive": true,
|
||||||
|
* "columnDefs": [ { "type": "sethigh", "targets": [2, ,3, 4, 7, 8] },
|
||||||
|
* { "type": "setlow", "targets": [5, 6] } ]
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* To change order later:
|
||||||
|
*
|
||||||
|
* gTable.order([8, 'asc'],[6, 'desc']).draw();
|
||||||
|
*
|
||||||
|
* Keep in mind there must be "desc" in this case not "dsc".
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set novalue pattern below if You want other.
|
||||||
|
* For example:
|
||||||
|
*
|
||||||
|
* var novalue = 'N/A';
|
||||||
|
* var novalue = 'no value';
|
||||||
|
* var novalue = 'empty';
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
var novalue = '-';
|
||||||
|
|
||||||
|
$.extend( $.fn.dataTableExt.oSort, {
|
||||||
|
|
||||||
|
"sethigh-asc": function ( a, b ) {
|
||||||
|
|
||||||
|
let x = a;
|
||||||
|
let y = b;
|
||||||
|
|
||||||
|
if (x == novalue && y != novalue) { return 1; }
|
||||||
|
else if (x != novalue && y == novalue) { return -1; }
|
||||||
|
else if (x == novalue && y == novalue) { return 0; }
|
||||||
|
else if (x != novalue && y != novalue) {
|
||||||
|
|
||||||
|
x = parseFloat(a);
|
||||||
|
y = parseFloat(b);
|
||||||
|
|
||||||
|
return ( (x < y) ? -1 : ( (x > y) ? 1 : 0 ) );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sethigh-desc": function ( a, b ) {
|
||||||
|
|
||||||
|
let x = a;
|
||||||
|
let y = b;
|
||||||
|
|
||||||
|
if (x == novalue && y != novalue) { return -1; }
|
||||||
|
else if (x != novalue && y == novalue) { return 1; }
|
||||||
|
else if (x == novalue && y == novalue) { return 0; }
|
||||||
|
else if (x != novalue && y != novalue) {
|
||||||
|
|
||||||
|
x = parseFloat(a);
|
||||||
|
y = parseFloat(b);
|
||||||
|
|
||||||
|
return ( (x < y) ? 1 : ( (x > y) ? -1 : 0 ) );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"setlow-asc": function ( a, b ) {
|
||||||
|
|
||||||
|
let x = a;
|
||||||
|
let y = b;
|
||||||
|
|
||||||
|
if (x == novalue && y != novalue) { return -1; }
|
||||||
|
else if (x != novalue && y == novalue) { return 1; }
|
||||||
|
else if (x == novalue && y == novalue) { return 0; }
|
||||||
|
else if (x != novalue && y != novalue) {
|
||||||
|
|
||||||
|
x = parseFloat(a);
|
||||||
|
y = parseFloat(b);
|
||||||
|
|
||||||
|
return ( (x < y) ? -1 : ( (x > y) ? 1 : 0 ) );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"setlow-desc": function ( a, b ) {
|
||||||
|
|
||||||
|
let x = a;
|
||||||
|
let y = b;
|
||||||
|
|
||||||
|
if (x == novalue && y != novalue) { return 1; }
|
||||||
|
else if (x != novalue && y == novalue) { return -1; }
|
||||||
|
else if (x == novalue && y == novalue) { return 0; }
|
||||||
|
else if (x != novalue && y != novalue) {
|
||||||
|
|
||||||
|
x = parseFloat(a);
|
||||||
|
y = parseFloat(b);
|
||||||
|
|
||||||
|
return ( (x < y) ? 1 : ( (x > y) ? -1 : 0 ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
Loading…
Reference in new issue