Possible to condense the current filter col's same data into an expandable single row?

Possible to condense the current filter col's same data into an expandable single row?

NoRefund17NoRefund17 Posts: 5Questions: 1Answers: 0
edited June 2018 in Free community support

Hi, I apologize ahead of time for my lack of coding knowledge, i'm still very new to this all.

Short: Is it possible to condense same data into an expandable single row when the matching data is currently selected as the sorting column?

Longer explanation if needed:
What I'm looking to do is use datatables for our podcast as an easy way to sort and search our episodes. So i'm curious if it is possible to be able to do the following. If i had Column of like "Episode Number" "Book" "Author" "date released". Would it be possible to setup datatables, if there are multiple episodes with the same author, or multiple episodes on the same book, to have it collapse all episodes for that Author (when author is selected as the sorting criteria) or book (when book is selected as sorting criteria) into a single row with only the book or author listed. than when its clicked on, expand to show all episodes that match that book or author entry.

If possible, could you point me in the right direction on how I might accomplish this?

Thank you so much in advance for your help :).

This question has accepted answers - jump to:

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    Hi @NoRefund17 ,

    If I understand correctly, you want something like a folder view, where expanding the 'author folder' shows their books within. If so, DataTables doesn't do that as standard, as it just shows all the records it has knowledge off. It can group by a column, such as the author, with RowGroup.

    It probably would be possible to do this with a lot of code. If I have time next week I might set myself the challenge - if I can do it, I'll report back.

    Cheers,

    Colin

  • NoRefund17NoRefund17 Posts: 5Questions: 1Answers: 0

    Hey Colin! thank you so much for the response. If you have time that would be fantastic! But if not, I really appreciate the answer anyway. Thank you very much.

  • NoRefund17NoRefund17 Posts: 5Questions: 1Answers: 0

    Sorry to be a huge pain, but if you end up not having time to give this feature a shot, could you maybe answer one more additional question.

    1. Can you have RowGroup dynamically change based on what you are sorting? Basically what i'm asking for above without the collapse? Or is this a static feature you set and cant manipulate. Anyway. Thank you so much for your help :)
  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    Hi @NoRefund17 ,

    Yep, you can change the grouping column on-the-fly programatically, see the example here.

    Cheers,

    Colin

  • NoRefund17NoRefund17 Posts: 5Questions: 1Answers: 0

    Ty so much colin. I thought i searched all the examples, but somehow I missed that one. Appreciate it :).

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    Hi @NoRefund17 ,

    Take a look at this example. It's not pretty, but it gives you an idea of what can be done with the API. In this example, you'll see a dropdown - if you select one, such as Office, where there's multiple values, and then click on one of the rows, you'll see it expand out into another table, which can be closed by clicking on it again.

    It's not particularly tidy or elegant, it's more of an example, but hope that gives you some ideas on how to tackle the problem,

    Cheers,

    Colin

  • NoRefund17NoRefund17 Posts: 5Questions: 1Answers: 0

    Ur a wizard harry.

    Seriously though thank you for taking the time. I don't know java-script very well, but i'll play around with this and see if I can't figure it out. Thank you so much :).

This discussion has been closed.