Okay
  Public Ticket #3646188
Custom selectbox
Closed

Comments

  • Aerosmite started the conversation

    Dear Mrs./Mr.

    I have a csv file with a column "Programs" that contains a list of values, for instance "['Agricultural Sciences Master', 'Management, Technology and Economics Master']" could be one cell. I want to have a selectbox filter with "Agricultural Sciences Master", "'Management, Technology and Economics Master", "Physics Master"... as options and if the list contains it (i.e. included in the text representing the list) it is selected. Would it be possible to do it?

    Attached files:  Catalogue_2024S_selection.csv

  •  2,572
    Aleksandar replied

    Hello there and thank you for reaching out to us.

    If the value of a single cell is this:

    ['Environmental Sciences Master', 'Science, Technology, and Policy Master', 'Agricultural Sciences Master', 'Spatial Development and Infrastructure Systems Master', 'MAS in Sustainable Water Resources', 'Doctorate Environmental Systems Sciences']

    That will be seen as a single value in wpDataTables.

    You would need to manually define values within the column:

    6871921525.png

    And that way, you'd be able to use it in the way you described:

    9990182075.png

    I'm afraid there's no other way to achieve this.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Aerosmite replied

    Hey Alksandar, thanks for your quick response!

    This is exactly what I was looking for :) However, as can be seen in your screenshot they seem to be an issue with comma, values like "Science, Technology, and Policy Master" seems to be separated into "Science", "Technology", "and Policy Master" automatically. Any idea on how to solve that?


    One other small question: is it possible to change the values visible in a selectbox depending on the value selected in an other selectbox? For instance when I select "Agricultural Sciences Master" as department I only want to display "Biotechnology Master", "Computational Biology and Bioinformatics Master", "Doctorate Biosystems Science and Engineering" and "Exchange Students" in my Programs selectbox. Is it possible?

    Thanks in advance,

    Mathieu

  •  2,572
    Aleksandar replied

    Hi again Mathieu.

    Unfortunately, the comma is a delimiter, and there's no way to include strings with multiple values separated by commas through the plugin. The only way you could implement it with the predefined values is through the database.

    You'd need to access the wp_wpdatatables_columns table, find the ID of the table, and then identify the column that needs to include multiple values separated by commas. Then, you need to edit the cell related to this column in the "possible_values" (database) column, like this:

    4351607960.png

    As they are separated with pipes in the database, you will be able to include commas:

    4257474531.png

    As for your other question - that's something we call cascade filtering and it's available only with our paid add-on Powerful Filters. It changes the filtering options based on the previously selected filter. You can give it a go and even test it on our sandbox site before purchase to see if it will work for you.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Aerosmite replied

    Hi Aleksandar,


    Can give more detail on how to add/access this "possible_values" column? I couldn't find the "wp_wpdatatables_columns" table anywhere.

    Mathieu

  •  2,572
    Aleksandar replied

    Hi again Mathieu.

    In your database, there are tables linked to wpDataTables. The "wp_" is the default prefix of WordPress database tables, but it could be anything on your end, so look for "your_prefix_wpdatatables_columns" table, where "your_prefix_" would be the same prefix you see for all database tables.

    When you access this table, you will see a list of all columns created in wpDataTables, where you'll identify the column by the ID of the table and the name of the column. For example:

    7934713152.png

    Scrolling to the right of this table, you'll see the "possible_values" column, that you need to edit:

    1315534020.png

    Once you edit it, add all the criteria you need, separated by pipes | and it should work.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables