external library not working after resizing datatables table for mobile

external library not working after resizing datatables table for mobile

sweetmansweetman Posts: 4Questions: 3Answers: 0

Hello all,
I have a datatabels table with a column that contains lots of text.
So I use the readmore.js library (https://jedfoster.com/Readmore.js/) to show trimmed text and allow the user to display the full text clicking the 'read more' link.
This work perfectly on tables that are not responsive.
If a table is responsive and you display it on mobile (resized) the readmore library stops to work.
Is there a way to make it work again?
Thanks in advance.
Tony

Answers

  • colincolin Posts: 15,146Questions: 1Answers: 2,587

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • sweetmansweetman Posts: 4Questions: 3Answers: 0
    edited March 2021

    Hello Colin,
    thanks for your reply.
    Here is a link with a sample: t.ly/dCG8

    As you can see the [read more] link will work until the cell is displayed in the regular table.
    If you resize the browser window to make it display only the first two columns, you will see that the [read more] link will not work anymore.

    What I would like to obtain is to completely disable the read-more script when the cells that contains these links are hidden. So that when I click the PLUS icon in the datatables heading, the full text will be displayed; in fact, there is no need to use the read-more feature since datatables already does this.

    The read-more script provides a method to destroy the read-more feature, but I can't figure out how to implement this feature inside a datatable.

    Hope this is clear enough.
    TIA
    tony

  • colincolin Posts: 15,146Questions: 1Answers: 2,587

    Ah I see. I think this example from this thread should help. It's handling the two cases of clicking the icon - in that example it increments a number, for you, it would display that text.

    Colin

This discussion has been closed.