PHP Classes

File: source/asset/crules/datatables-plugins/filtering/row-based/range_numbers.js

Recommend this page to a friend!
  Classes of ask sa sa   Rimau waf   source/asset/crules/datatables-plugins/filtering/row-based/range_numbers.js   Download  
File: source/asset/crules/datatables-plugins/filtering/row-based/range_numbers.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Rimau waf
Application to configure Web server module options
Author: By
Last change:
Date: 1 year ago
Size: 1,283 bytes
 

Contents

Class file image Download
/** * Filter a specific numeric column on the value being between two given * numbers. Note that you will likely need to change the id's on the inputs * and the column in which the numeric value is given. * * @summary Filter the data between two numbers (inclusive) * @name Range filtering (numbers) * @author [Allan Jardine](http://sprymedia.co.uk) * * @example * $(document).ready(function() { * // Initialise datatables * var table = $('#example').DataTable(); * * // Add event listeners to the two range filtering inputs * $('#min').keyup( function() { table.draw(); } ); * $('#max').keyup( function() { table.draw(); } ); * } ); */ jQuery.fn.dataTableExt.afnFiltering.push( function( oSettings, aData, iDataIndex ) { var iColumn = 3; var iMin = document.getElementById('min').value * 1; var iMax = document.getElementById('max').value * 1; var iVersion = aData[iColumn] == "-" ? 0 : aData[iColumn]*1; if ( iMin === "" && iMax === "" ) { return true; } else if ( iMin === "" && iVersion < iMax ) { return true; } else if ( iMin < iVersion && "" === iMax ) { return true; } else if ( iMin < iVersion && iVersion < iMax ) { return true; } return false; } );