1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-18 11:52:11 +01:00

Fix example: Improve code for multi-column select example

This commit is contained in:
Allan Jardine 2014-10-10 10:54:11 +01:00
parent cfe6b6dce3
commit e06931ee0b
7 changed files with 8 additions and 10 deletions

View File

@ -1 +1 @@
ddb316f8b4c3d8938778cf65d0be6d717d87d00d
a9bbdfbf0a63a9bc54a743172e873cc1d5045973

View File

@ -1,6 +1,6 @@
{
"name": "datatables",
"version": "1.10.3",
"version": "1.10.4-dev",
"main": [
"media/js/jquery.dataTables.js",
"media/css/jquery.dataTables.css"

View File

@ -1,6 +1,6 @@
{
"name": "datatables/datatables",
"version": "1.10.3",
"version": "1.10.4-dev",
"description": "DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool, based upon the foundations of progressive enhancement, which will add advanced interaction controls to any HTML table.",
"homepage": "http://www.datatables.net/",
"author": "SpryMedia",

View File

@ -1,6 +1,6 @@
{
"name": "DataTables",
"version": "1.10.3",
"version": "1.10.4-dev",
"description": "DataTables enhances HTML tables with the ability to sort, filter and page the data in the table very easily. It provides a comprehensive API and set of configuration options, allowing you to consume data from virtually any data source.",
"homepage": "http://datatables.net/",
"docs": "http://datatables.net/",

View File

@ -26,14 +26,13 @@ $(document).ready(function() {
api.columns().indexes().flatten().each( function ( i ) {
var column = api.column( i );
console.log( i );
var select = $('<select><option value=""></option></select>')
.appendTo( $(column.footer()).empty() )
.on( 'change', function () {
var val = $(this).val();
column
.search( val ? '^'+$(this).val()+'$' : val, true, false )
.search( val ? '^'+val+'$' : '', true, false )
.draw();
} );
@ -592,14 +591,13 @@ $(document).ready(function() {
api.columns().indexes().flatten().each( function ( i ) {
var column = api.column( i );
console.log( i );
var select = $('&lt;select&gt;&lt;option value=&quot;&quot;&gt;&lt;/option&gt;&lt;/select&gt;')
.appendTo( $(column.footer()).empty() )
.on( 'change', function () {
var val = $(this).val();
column
.search( val ? '^'+$(this).val()+'$' : val, true, false )
.search( val ? '^'+val+'$' : '', true, false )
.draw();
} );

View File

@ -1,4 +1,4 @@
/*! DataTables 1.10.3
/*! DataTables 1.10.4-dev
* ©2008-2014 SpryMedia Ltd - datatables.net/license
*/
(function(Da,P,l){var O=function(h){function V(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()),d[c]=e,"o"===b[1]&&V(a[e])});a._hungarianMap=d}function G(a,b,c){a._hungarianMap||V(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==l&&(c||b[d]===l))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),G(a[d],b[d],c)):b[d]=b[e]})}function O(a){var b=p.defaults.oLanguage,c=a.sZeroRecords;

View File

@ -1,6 +1,6 @@
{
"name": "DataTables",
"version": "1.10.3",
"version": "1.10.4-dev",
"title": "DataTables",
"author": {
"name": "Allan Jardine",