Okay
  Public Ticket #2989933
Paginate the table based on values?
Closed

Comments

  • Linus Lancin started the conversation

    In a table there will be a couple of 100's of rows. These will cointain ratings about different items. As each item can have one or more rating, it would be usefull if the user could look at all of the rows for one item at the time. Like if item 1 has 7 rows, the first page would show the table with these 7 rows, and the next page would show the rows for item 2.


    Could this be easily done, or can I use a shortcode to set the filter and simply call the table one time per item?


    Thanks,

    /Linus

  •  2,572
    Aleksandar replied

    Hello Linus

    Thank you for your purchase.

    I am sorry to disappoint you, but unfortunately, something like this is not possible with the plugin's built-in features.

    You would, however, be able to add %VAR1% as a predefined filtering value for a column, in column settings:

    3647400580.png

    Then, through the shortcode, you'd be able to use the same table on multiple pages, but filter the table per a different item.

    For example if your items are added as "IDs", you could add [wpdatatable id=1 var1=15] for item "15", [wpdatatable id=1 var1=4] for item "4", and so on.

    Please note that adding a variable placeholder like this is only possible for "Text" filter type, and that you should not define the value of the placeholder in the "Placeholders" tab above the table.

    If you want to prevent users from changing this value, you can send us the URL to the table, so we can find some custom CSS to hide the filter.

    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

  • Linus Lancin replied

    Hi Aleksandar,

    Your suggestion worked almost all the way to meet my needs. Using the predefined filtering and %VAR1% I can create the filtered table, and am able to edit the column that I want, that is not the same as the identifier that we are filtering on.


    However. After make an edit to a row, the wpDataBable refreshes directly, without reloading the whole page, and therefore the unfiltered table is shown. If I refresh the whole page, the %VAR1% comes into play again, and the filter applies.


    Could there be a setting to force the filter to apply not only when the page is reloaded, but when the table is as well?


    Thanks,

    /Linus

  •  2,572
    Aleksandar replied

    Hello Linus

    I can't replicate that behavior. If I add %VAR1% as a predefined filtering value of a column, that's what's going to be applied regardless of whether I edit the table, or even add a new row.

    Please check the attached screen recording.

    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

  • Linus Lancin replied

    Good morning,

    I have been able to replicate the issue. It appears that if the "Advance column filter" for the table is disabled, the behaviour occurs. If I enable it again, the page behaves as wanted, i.e. the filter on the column is applied even if the whole page is not reloaded.

    Please see attached screen capture.

    The desired behaviour would be to have the filter to be applied even if the the Advanced filter is not shown to the user.

    /Linus

  •  2,572
    Aleksandar replied

    Well, yes, Linus, that's the logic of the plugin. The filter can't be applied if Filtering is disabled for the table.

    That is why I mentioned this in the initial response:

    If you want to prevent users from changing this value, you can send us the URL to the table, so we can find some custom CSS to hide the filter.

    This is how you hide the filter from the front-end user. Or you can create a MySQL query-based table that will pull only the values you need, so you don't have to enable filtering for that table.

    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