I need the filter to reset upon selection change
I need the filter to reset upon selection change
DataTablesUser
Posts: 19Questions: 0Answers: 0
I have a select drop down box with data corresponding to each option. When I change from one option to another, it retains the info that I typed into the search. I want the info to be cleared when I switch to another option from the select input. I made a function that clears the value of the text input and makes it so that value=""...but this doesnt clear it. I binded the text box to click, mouseenter and mouseleave as well as the original keyup...So when I switch to another option, It clears when I click the search input or just put the mouse over it...but I need it to be cleared on option change.
Also, I want a submit button next to the search input field so that the filtered data doesnt show up until the user presses the submit button.
Any ideas?
Also, I want a submit button next to the search input field so that the filtered data doesnt show up until the user presses the submit button.
Any ideas?
This discussion has been closed.
Replies
$('.dataTables_filter input').val('').keyup();
But now I need to figure out a way to only show the data once an exact match is found...right now I have it searching zip codes, and as you type the digits it shows everything that includes those digits...but I want it to only display the results at 5 digits, and only the result that is an exact match at that point...anything less than 5 digits I want the table to dissapear
right now its displaying the full data set when the input has less than 5 digits, i need it to display an empty data set
i tried putting "_fnClearTable();" in there...but it says that aoData is null or not an object....i'm assuming that's because its not defined yet but im not sure...
* If the input is blank - we want the full data set
*/
if ( sInput.length <5 )
{
oSettings.aiDisplay.splice( 0, oSettings.aiDisplay.length);
oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
}