Add Watermark to Search Box
Add Watermark to Search Box
jxb
Posts: 6Questions: 4Answers: 0
I've been lookingbut can't seem to find out how to add a watermark to the search box that filters the table.
I'm a datatables noob
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Have a look at this github issue (I'm assuming you mean a placeholder?).
Allan
Yep, that's awesome and yes placeholder is the correct term. I have one more question though, I am doing my table initialization in a the prototype of an object which binds the table to the HTML element. It defined some properties like the url that the JSON data will be coming from, the table itself is a property, and a couple others (date field values). There is really only one function inside the prototype, called setupEvents(). Inside setupEvents() is where the table's actual initialization is done (ajax calls and the custom stuff). Then when the document is ready, I just tell the interpreter I want a
new
one of those objects.The table's initialization is a function within the setup function's scope.
My question is, where the heck do I add the call to the
attr
function of the table (in the example you gave me)? Outside of everything? In the $(document).ready() block? Inside the prototype as a property? I'm trying to get used to JavaScript but it's not clear to me what belongs where. Thanks again for the helpInside the $(document).ready(), after (outside of) the dataTables initialization.