Client-side processing mode
In client-side processing mode full dataset is available once table has been initialized. The trick is to iterate over each cell and add its data to a list that will be used as data source for autocomplete control.
Example
Server-side processing mode
In server-side processing mode only single page data is available at all times. You would need to implement a way to lookup suggestions on the server and query that data using Ajax request.
In the example below I am using pre-populated plain array to emulate response from the server for demonstration purposes. Your server-side method should query the database and return only relevant search results as plain array in JSON format.
It also would make sense to limit the number of search results to the number of items you want to shown in autocomplete control, default number of suggestions is 8
controlled by items option.
I want to disable filter and other setting. How can I do that?
See searching option to control searching (filtering) ability. See all options for more information.
Thanks but i need to fix this
“Now i am facing one more issue that the data coming from DB contain “&” sign, but this plugin render “&” sign as “&” due to which my search is not working well. any solution ??”
I have updated client-side example with a fix that should solve the problem with HTML entities.
Now i am facing one more issue that the data coming from DB contain “&” sign, but this plugin render “&” sign as “&” due to which my search is not working well. any solution ??
Thanks ! i fix that issue by using the following.
“paging”: false,
“ordering”: false,
“info”: true,
Now i am facing one more issue that the data coming from DB contain “&” sign, but this plugin render “&” sign as “&” due to which my search is not working well. any solution ??
Please see updated client-side example that solves the problem with HTML entities.
@Michael Ryvkin
Thanks Bro !
You saved my day 🙂
By the way great article.
@Michael Ryvkin Sir i was wondering is there any option/way to sort data data when input list drop down ? Like when i type “JA” in your text input field the drop down data will be shown in alphabetical order.
Waiting for your kind response !
I updated both examples so that data is sorted alphabetically. Thanks for reporting this issue.
Thanks Sir for your kind response 🙂
Can you share me this code in the example?
The code is in examples on JSFiddle, just select HTML/JavaScript/Resources tabs or click on the “Edit in JSFiddle” link for each example.
Ohm tks you very much.
I have a final project at school and i want to search with database “phalcon framewwork” Can you give me a little guidance?
I am not able to see the drop down using above code i am able to see its getting generated in inspect element but not visible any reason for the same
Can you provide an example demonstrating the problem?
Hi Micheal Thanks for replying back , it was css issue, figured it out thanks for the tutorials … respect
Thank you it works fine. But my table cells are contenteditable. After editing a cell the new cell value does not come into the autocomplete. can you help please? Thank you again.
I assume you modify cell content directly which DataTables plugin is unaware of. From the official documentation:
There are two DataTables API methods that could be helpful in this case.
Thank you, it works with invalidate(). and i apply it for a full row in order to have all cells from that row updates. Like this : api.row(indextr).invalidate();
Great thanks again
Hi sir! Datatables search box is not working when the table contains textbox values. Kindly share a solution for this issue.
Unfortunately this is not well documented on DataTables.net. Please see this answer I posted on StackOverflow some time ago.