when added selectmenu() to a select, it stopped its event
Hi,
I have a dropdown :
- <div>
- Enabled/Disabled<br />
- <select id="enabledChoice">
- <option value="All">All</option>
- <option value="F">Enabled</option>
- <option value="T">Disabled</option>
- </select>
- </DIV>
-
-
it filter a table by showing all , or just enabled or just disabled, as soon as I added jquery ui and did :
- $(function($){
- $('select#enabledChoice').selectmenu();
The following code (for filtering displayed table) stopped working.
-
- // select enable/disable
- $("#enabledChoice").click( function() {
- console.log('click');
- oTable.fnDraw();
- });
-
- $.fn.dataTableExt.afnFiltering.push(function( oSettings, aData, iDataIndex ) {
- var chosenName = $("select#enabledChoice").val(); // Grab selected item in the dropdown list
- var nameInColumn = aData[9]; // 9 is the index (begins from 0) of the column I want to sort
- // If nothing or "All" is selected, don't filter
- if ( chosenName == "" || chosenName == "All")
- {
- return true;
- }
- else if ( chosenName == nameInColumn)
- {
- return true;
- }
- return false;
- });
Thanks, your help is appreciated.