• Resolved nrahley

    (@nrahley)


    Hello,

    I love this plugin, but I am having a few problems with the column filtering. Some of the dropdown filters are working, and some are not. Do you have any idea why this happens when I choose a college partner nothing shows up? It is also doing that on the Program dropdown. Some show up and some do not. Here is a link to my table: http://hired.center/education/degree-programs/

    Also, is there a way to display the dropdown filters on one line. Sometimes they are on one line and other times it is showing two lines.

    https://wordpress.org/plugins/tablepress/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The problem in the “Partner University” column is that it contains HTML code. As that HTML code contains quotation marks ", the ColumnFilterWidgets JavaScript code is thrown off, unfortunately.
    The workaround here would be to add another column that only has the partner names (without the link), but that is hidden to the visitor. We can then instruct the ColumnFilterWidgets JS to use that column for the filtering, instead of the column with the links.
    For example, add that new column as the 5th column. Then, add this to the “Custom Commands” textfield on the “Edit” screen to hide it from the visitor:

    "columnDefs": [ { "visible": false, "targets": [ 4 ] } ]

    (the 4 in this code means 5th column, as counting starts with 0).

    Also, change your Shortcode to

    [table id=1 datatables_columnfilterwidgets=true datatables_columnfilterwidgets_exclude_columns="4" /]

    to hide the not working drowdown. (The 4 in this code does mean 4th drop-down, as counting in this Shortcode starts with 1.)

    Then, the problem in some cells (e.g. in the first column) is that the contain empty lines at the end. This is the reason why in the first drop down, some entries like “Bachelor Degree” appear multiple times. You must remove all line breaks after that text in those cells (this is for example in rows 7, 9, 13, etc., which all have 4 line breaks).

    Finally, the long widths of the drop downs is caused by the amount of content in their respective cells. To limit the width, you could add this to the “Custom CSS” textarea on “Plugin Options” screen of TablePress:

    #tablepress-1_wrapper .column-filter-widget select {
      max-width: 200px;
    }

    Regards,
    Tobias

    Thread Starter nrahley

    (@nrahley)

    It worked perfectly. Thank you so much!

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘WordPress Column Filtering’ is closed to new replies.