Placeholder in input search control
Placeholder in input search control
Link to test case: NA
Debugger code (debug.datatables.net): NA
Error messages shown: NA
Description of problem: Hello,
Can you tell me if it is possible to display in the HTML input text field of the columnControl component a specific placeHolder or one that would take the title of the column to which it is attached?
Thanks in advance for your answer and have a nice day.
Lolo
This question has an accepted answers - jump to answer
Answers
Hi Lolo,
Yes, you can use the
placeholderoption for the various search content types. As the docs say, use[title]if you want it to show the column title, or you can doSearch [title]...etc.Allan
Hi @allan,
I ma not sure to understand the way to use the option.
I have done a small test case if you want to have a look.
https://live.datatables.net/saqeyumi/1/edit
I was able to "extend" the "search" functionality but not like I really want.
You'll need to explain to me what you do want then, since you have the
placeholderoption being set tobar, wchi is appearing as the placeholder for the search inputs:Allan
Actually, I just want the text box placeholder to automatically take the value of the column title.
Like this:

Use
[title]like I mentioned above in that case: https://live.datatables.net/saqeyumi/2/edit .Allan
Thanks a lot @allan,
It works very well
Sorry, I didn't quite understand how to use the property.
Now that I see the solution, I understand the documentation better.
Besides, it's not trivial that we have to use (and not documented on the link you gave me):
{ extend: "search", placeholder: "[title]", },
Luckily I had already used this syntax for buttons so I was inspired by it