Jquery UI breaking all other tables on website -



Jquery UI breaking all other tables on website -

i using jquery script called datatables, adds lot of functions tables searching , filtering etc , enables skin tables jquery ui. trying replicate next illustration on website can filter columns. http://www.datatables.net/release-datatables/examples/api/multi_filter_select.html problem having now, when utilize next script on website strips away jquery ui on other tables.

for illustration on 1 of other tables have set in of page :

$(document).ready( function() { $('#mailinglistmanager').datatable( { "bjqueryui": true, "binfo": true, "bautowidth": true, "bfilter": false, "blengthchange": true, "bpaginate": true, "bprocessing": true, "bsort": true, "spaginationtype": "full_numbers", "aasorting": [[ 6, "desc" ]], "idisplaylength": 100, "blengthchange": false } ); }); </script>

this , other tables seem work fine until add together code below, happens other tables stripped of jquery ui , table defined below skinned then, , other tables unskinned.

(function($) { /* * function: fngetcolumndata * purpose: homecoming array of table values particular column. * returns: array string: 1d info array * inputs: object:osettings - datatable settings object. lastly argument past function * int:icolumn - id of column extract info * bool:bunique - optional - if set false duplicated values not filtered out * bool:bfiltered - optional - if set false table info used (not filtered) * bool:bignoreempty - optional - if set false empty values not filtered result array * author: benedikt forchhammer <b.forchhammer /at\ mind2.de> */ $.fn.datatableext.oapi.fngetcolumndata = function ( osettings, icolumn, bunique, bfiltered, bignoreempty ) { // check have column id if ( typeof icolumn == "undefined" ) homecoming new array(); // default wany unique info if ( typeof bunique == "undefined" ) bunique = true; // default want @ filtered info if ( typeof bfiltered == "undefined" ) bfiltered = true; // default not wany include empty values if ( typeof bignoreempty == "undefined" ) bignoreempty = true; // list of rows we're going loop through var airows; // utilize filtered rows if (bfiltered == true) airows = osettings.aidisplay; // utilize rows else airows = osettings.aidisplaymaster; // row numbers // set info array var asresultdata = new array(); (var i=0,c=airows.length; i<c; i++) { irow = airows[i]; var adata = this.fngetdata(irow); var svalue = adata[icolumn]; // ignore empty values? if (bignoreempty == true && svalue.length == 0) continue; // ignore unique values? else if (bunique == true && jquery.inarray(svalue, asresultdata) > -1) continue; // else force value onto result info array else asresultdata.push(svalue); } homecoming asresultdata; }}(jquery)); function fncreateselect( adata ) { var r='<select><option value=""></option>', i, ilen=adata.length; ( i=0 ; i<ilen ; i++ ) { r += '<option value="'+adata[i]+'">'+adata[i]+'</option>'; } homecoming r+'</select>'; } $(document).ready(function() { /* initialise datatable */ var otable = $('#dashboard').datatable( { "bjqueryui": true, "binfo": true, "bautowidth": true, "bfilter": true, "blengthchange": true, "bpaginate": true, "bprocessing": true, "bsort": true, "spaginationtype": "full_numbers", "aasorting": [[ 9, "desc" ]], "idisplaylength": 5, "blengthchange": false } ); /* add together select menu each th element in table footer */ $("tfoot th").each( function ( ) { this.innerhtml = fncreateselect( otable.fngetcolumndata(i) ); $('select', this).change( function () { otable.fnfilter( $(this).val(), ); } ); } ); } );

your jquery selector fncreateselect selects th elements in every tfoot every table. since other tables apparently affected, seek changing $("tfoot th") $("#dashboard tfoot th") select tfoot table.

jquery table datatable datatables

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -