Button search

Button search

TheMentorTheMentor Posts: 1Questions: 0Answers: 0
edited December 2011 in Feature requests
Hi!

First of all. Great plugin and thank you for your time developing it!

I think a good feature would be to have a setting where you could simply just turn on or off search for each character or on key press, near search textbox should also be a button search which would be also optional (show = true or false)

I already implemented (if I am hones I found it on the net :) ) search on keyup

//event for search on enter keyup
$(function () {
$('.dataTables_filter input').unbind('keyup').bind('keyup', function (e) {
if (e.keyCode != 13) return;
oTable.fnFilter($(this).val());
});
});

Best Regards!

Replies

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    Nice one - thanks for posting your code :-).

    There are quite a number of different ways that the filtering input could be customised, inkling having a key press delay (like this plug-in: http://datatables.net/plug-ins/api#fnSetFilteringDelay), having it only filter on return (http://datatables.net/plug-ins/api#fnFilterOnReturn) or having a button added (no plug-in for that yet, but I've seen it done).

    As such, I think I'd prefer to keep the basic implementation nice and generic, and ensure that customisations such as this can be done easily.

    Regards,
    Allan
This discussion has been closed.