friendly search box

friendly search box

jcampbell2000jcampbell2000 Posts: 3Questions: 0Answers: 0
edited January 2010 in General
Hello, with regard to the multi-filter example (http://datatables.net/examples/api/multi_filter.html), how can I modify the "Search all columns" box so that the descriptor is in grey inside the box, as it is on the footer search boxes?

Thank you

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    The example code covers just about everything you need for this. 'this.className = "";' for normal text and this.className = "search_init"; for grey text. You can then manipulate it around as you wish.

    Allan
  • jcampbell2000jcampbell2000 Posts: 3Questions: 0Answers: 0
    Thanks for your help. I'm new to jquery and I can't work out how to identify the global search box. This does not work:

    $("example_filter input").val('Search all columns');
    $("example_filter input").addClass('search_init');
  • jcampbell2000jcampbell2000 Posts: 3Questions: 0Answers: 0
    Sorry, rookie mistake, this works:

    $("#example_filter input").val('Search all columns');
    $("#example_filter input").addClass('search_init');

    However, although it adds the search_init class to input box, the text in the box is still black. Not sure why, but I just switched to changing the style tag on the box instead.

    Thanks for your help.
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    I suspect that there will be a style overriding the search_init class somewhere. If you 'inspect' the element with Firebug or Inspector then you'll be able to see how the browser is calculating the style application.

    Regards,
    Allan
This discussion has been closed.