WordPress.org

Forums

Custom List Table Example
Multiple tables on one page, is it possible? (3 posts)

  1. 2unco
    Member
    Posted 3 years ago #

    First off, I thank you Matt for providing this plugin. An excellent piece of documentation indeed.

    I tried to extend your example such that a second table could be displayed on the same page. To do this, I declared and defined a new TT_Example_List_Table variable and prepared it, copied the form (changed the IDs so they don't clash) and used the corresponding variables for display().

    The first problem I encountered was an attempted re-definition of the usort_reorder function. This was easily fixed, I'm just recommending that you consider covering that in a potential next version of the plugin - if you see it fit.

    After that it displayed fine. The problems occured when changing pages. Quite visibly (through method="get"), you could see that the page number was not specific to any table: "&paged=2". As such, all tables displayed had their pages simultaneously changed.

    This has quite obvious problems, and I think that (while utilising the WP_List_Table class) it cannot be fixed without overriding some of the methods.

    Just wanted to let you know and see what you think, it would be a nice extra coverage in your plugin - working with multiple tables.

    http://wordpress.org/extend/plugins/custom-list-table-example/

  2. Matt van Andel
    Member
    Plugin Author

    Posted 3 years ago #

    Great point, 2unco. I'll take a look at this as soon as I have a bit of time. Being limited to one table per page without a bit of hackery is a pretty big road block that should definitely be addressed.

  3. 2unco
    Member
    Posted 3 years ago #

    Let me know how it goes :)

    There's still quite a few features that would be useful to incorporate in to this nice plugin. Most of which can be seen on the Admin Posts page.

    I had to figure out views and found practically 0 documentation on it. The source code is painfully scattered. I managed, eventually, but not without difficulty. I think that would be nice to include in this plugin, if you can find the time.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom List Table Example
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic