Okay
  Public Ticket #1853111
ad8fa4f6-7b73-4aba-****-******
Closed

Comments

  • hiimmike started the conversation

    Hi,

    Is there a way to filter so that a user can compare two rows? I am not sure how I might implement this feature.

    Thanks!

  •  2,572
    Aleksandar replied

    Hello hiimmike.

    Thank You for Your purchase.

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

    You can take a look at our documentation on sorting, where You can see how users can sort by two columns by holding down "Shift", or by looking into advanced filtering, but I don't think it'll provide the perfect solution to what it is You're asking.

    Can You, please add some examples to Your reply, so that we can see an example of what it is You're asking?

    Best regards.

    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

  • hiimmike replied

    Ok, thanks for the reply.

    I did some thinking around how I may still be able to compare two searchable tables and came up with a method.

    • I made a table with 10 rows, and then made a duplicate of the table but modified the options to display only one.
    • In my them, I made the first table sticky on scroll. Now only one table is in view while scrolling over the others.
    • I also have horizontal scrolling enabled in the the table options for both.

    This solution fits my use-case pretty well. But the final question is how do I keep the scroll position of both tables in sync? I tried a couple code snippets, but couldn't get it to work. Here is the one I thought could work easily:

    var div1 = $('table_1_wrapper');
    var div2 = $('table_3_wrapper');

    div1.scroll(function() {
        div2.scrollLeft($(this).scrollLeft());
    });

    div2.scroll(function() {
        div1.scrollLeft($(this).scrollLeft());
    });


    Here's a link to what I am trying to achieve with two tables: https://codepen.io/avnish002/pen/KvqjmP

    Could you guide me in the right direction for which selector I should target? Thanks!A

    Attached is how it looks so far in my playground.


  •  2,572
    Aleksandar replied

    Hello again hiimmike.

    Good job on finding a work around.

    As for this script, I cannot say what would be required for it to work. The selectors look fine. Maybe you can try replacing the $ sign with "jQuery" and also try adding something like:

    jQuery(document).ready(function()
    

    so the script loads when the page is loaded. I also noticed that the script looks like this in the link you provided:

    var div1 = $('#scrollDiv-1');
    

    While your script looks like this:

    var div1 = $('table_1_wrapper');
    

    I am sorry, but this is as much as I can do. Included support covers help with bugs and general inquiries for the plugin features, but not writing custom code.

    Thank you for your understanding.

    Best regards.

    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