Add Watermark to Search Box

Add Watermark to Search Box

jxbjxb Posts: 6Questions: 4Answers: 0
edited May 2014 in Free community support

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

Answers

  • allanallan Posts: 61,664Questions: 1Answers: 10,095 Site admin
    Answer ✓

    Have a look at this github issue (I'm assuming you mean a placeholder?).

    Allan

  • jxbjxb Posts: 6Questions: 4Answers: 0
    edited May 2014

    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 help

  • jlbriggsjlbriggs Posts: 15Questions: 2Answers: 1
    edited May 2014

    Inside the $(document).ready(), after (outside of) the dataTables initialization.

This discussion has been closed.