Howto to implement Datatables with default WordPress WP_List_Tables

Howto to implement Datatables with default WordPress WP_List_Tables

studiolelandstudioleland Posts: 22Questions: 1Answers: 0
edited November 2012 in General
I am trying to work out how to implement the Datatables sort/filter/pagination behavior with the default admin post, pages, posttype, etc tables by post type. That will really expand functionality especially with larger WP sites having 50+ pages, 300+ posts. I assume I can use some of the admin hooks to apply this script conditionally by post type to the WP_List_Tables but I just don't know where to begin. Any help much appreciated here?

Replies

  • allanallan Posts: 63,531Questions: 1Answers: 10,474 Site admin
    I'm afraid I really can't offer any help as I don't know WordPress at all. I assume you are right that there are hooks somewhere that you could do a simple `$('table.datatable').dataTable();` on them when the page loads - but I don't know what that hook would be. You might be best asking in a WordPress specific forum on how to include and run Javascript the site pages.

    Allan
  • allanallan Posts: 63,531Questions: 1Answers: 10,474 Site admin
    I should also say, you might want to check out Tobais' WP Table Reloaded project: http://tobias.baethge.com/wordpress-plugins/wp-table-reloaded-english/ . Even if you don't use it, the code might give some WordPress integration clues.

    Allan
This discussion has been closed.