0

I am using the jQuery DataTables plugin to style a table (source: https://datatables.net/).

By default this shows an input field on top of a table that is used for searching / filtering the table with a default text "Search:" appearing in front of it. Checking this in Firebug shows the parent div with the following details: id="MyTableID_filter" class="dataTables_filter"

Can someone tell me a way to change this text or to replace the div content or is there a buil-in option that allows this ?

Many thanks for any help with this, Tim.

2
  • 1
    you want to change only the text ? search to something like for example filter: ? Commented Nov 23, 2013 at 13:26
  • Thanks. Yes, thats exactly what I am trying to do. Ideally I would like to replace both the field and the text. The have something built-in that allows you to do this with other features but I couldnt find anything to change the filter piece. Commented Nov 23, 2013 at 13:28

1 Answer 1

9

Try putting something like this in your script. That's allows you to modify the behaviour of your datatable. You can read here for your references

$("#datatable").dataTable({
            "bJQueryUI": false,
            "bAutoWidth": false,
            "oLanguage": {
        "sEmptyTable": "No incompleted albums found!", //when empty
                    "sSearch": "<span>Filter records:</span> _INPUT_", //search
                    "sLengthMenu": "<span>Show entries:</span> _MENU_", //label
                    "oPaginate": { "sFirst": "First", "sLast": "Last", "sNext": ">", "sPrevious": "<" } //pagination
            }
        });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.