1

The Jquery data table allows features such as pagination, search, page information, and # of items in one page. I only want the pagination functionality, and want to disable the rest. Could someone take a look at my code and see where the problem is?

$('#myTableId').DataTable()({
   "search" : false
   "info": false
});
1
  • 1
    I think you're missing a comma in the parameters of DataTable. Try this $('#myTableId').DataTable()({ "search" : false, "info": false }); Commented Jul 31, 2017 at 13:41

1 Answer 1

1

Remove the extra parenthesis from Datatable function, you must call it with the options inside

$('#myTableId').DataTable({ "search" : false, "info": false });
Sign up to request clarification or add additional context in comments.

3 Comments

Thank you Tushar! It works. One more question. I original have anohter line of code to disable one of the columns. But I was not able to combine them together. $('#myTableId').DataTable().column(0).visible( false ); $('#myTableId').DataTable({ "info": false });
I am not getting it. Can you explain bit more, or post another question :) If this helped then please accept or upvote.
Thanks for the help Tushar. I just figured it out by incorporating the other line of code into the datatable section. Thanks!

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.