Quite a nice idea using auto suggest on the filter box. This is a library I've had success with before (for other projects): http://www.pengoworks.com/workshop/jquery/autocomplete.htm
Basically what you will need to do is provide it will a callback function which will suggest the completion based on your data in the table. This could be done by parsing through the data stored in DataTables, or through some Ajax request.
the "id" of my datatable = "records".
I followed your suggestion to implement the autosuggest that you provided me. I think the id of the filter input text = (name of datatable)+"_filter" so i did the following:
Replies
Quite a nice idea using auto suggest on the filter box. This is a library I've had success with before (for other projects): http://www.pengoworks.com/workshop/jquery/autocomplete.htm
Basically what you will need to do is provide it will a callback function which will suggest the completion based on your data in the table. This could be done by parsing through the data stored in DataTables, or through some Ajax request.
Hope this helps,
Allan
Can You take a look at the following:
the "id" of my datatable = "records".
I followed your suggestion to implement the autosuggest that you provided me. I think the id of the filter input text = (name of datatable)+"_filter" so i did the following:
$(document).ready(function() {
$("#records_filter").autocompleteArray(
[
"test","testing","tester","tes"
],
{
delay:10,
minChars:1,
matchSubset:1,
onItemSelect:selectItem,
onFindValue:findValue,
autoFill:true,
maxItemsToShow:10
}
);
});
What am i doing wrong ?
Greetings and thx for your help in advance.
David
1. The ID isn't on the INPUT element, it's on the div wrapper. So your selector should be:
$("#records_filter input").autocompleteArray(
2. Make sure this runs after the DataTables initialisation.
I've just tired that and with works nicely.
Allan