PHP Classes

File: source/asset/crules/datatables-plugins/filtering/type-based/phoneNumber.js

Recommend this page to a friend!
  Classes of ask sa sa   Rimau waf   source/asset/crules/datatables-plugins/filtering/type-based/phoneNumber.js   Download  
File: source/asset/crules/datatables-plugins/filtering/type-based/phoneNumber.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,013 bytes
 

Contents

Class file image Download
/** * Telephone numbers are a common data point to display in HTML tables, and are * often formatted (e.g. `dt-string 555-1234`). Typically, when searching a * table a user would need to enter the number in exactly the same format it is * displayed in, but this is not always convenient (e.g. you might search for * `dt-string 5551`). * * This filtering plug-in will allow both forms to be matched be providing both * the formatted and de-formatted data to the table's search. * * @summary Make phone numbers searchable formatted or unformatted * @name Phone number * @author Allan Jardine * * @example * $(document).ready(function() { * $('#example').dataTable( { * columnDefs: [ * { type: 'phoneNumber', target: 4 } * ] * } ); * } ); */ jQuery.fn.DataTable.ext.type.search.phoneNumber = function ( data ) { return ! data ? '' : typeof data === 'string' ? data + data.replace(/[ \-]/g, '') : data; };