Getting Table Filter to work when adding text to Input via Javascript?
Getting Table Filter to work when adding text to Input via Javascript?
Hello,
I want to use the Datatables filter to filter out items from the table based on pre-defined keywords contained within my table.
The user can type in the filter which is great, but I want to give them "Shortcut" buttons with the text.
I have a working demo here http://jsfiddle.net/VjQ5L/4/
You can see when going through my buttons All - Firefox - Netscape - OSX etc I have JS working so it updates the value of the Filter Input Field.
Only problem is it does not filter, I need to press space on the keyboard for it to actually work.
I am sure there might be a quick solution like adding a filter call after each button is pressed or a blur event or something. I am just not sure how to do it..
Looking for some guidance!
Thanks //Steve
http://jsfiddle.net/VjQ5L/4/
I want to use the Datatables filter to filter out items from the table based on pre-defined keywords contained within my table.
The user can type in the filter which is great, but I want to give them "Shortcut" buttons with the text.
I have a working demo here http://jsfiddle.net/VjQ5L/4/
You can see when going through my buttons All - Firefox - Netscape - OSX etc I have JS working so it updates the value of the Filter Input Field.
Only problem is it does not filter, I need to press space on the keyboard for it to actually work.
I am sure there might be a quick solution like adding a filter call after each button is pressed or a blur event or something. I am just not sure how to do it..
Looking for some guidance!
Thanks //Steve
http://jsfiddle.net/VjQ5L/4/
This discussion has been closed.
Replies
Allan
Thanks, You could be right, I just don't really know how to do that? I did take a look at the API reference you sent but don't understand how to make this work for my example.
Would you be able to kindly provide me with some more insight or direction into how I might be able to achieve this using the method you suggest? Felt I was nearly there with what I had :)
Cheers S
I surprised myself and got it to work! Thanks for the Tip Allan!!!
http://jsfiddle.net/VjQ5L/5/
//S