Combining multiple columns and showing as one in searchpane

Combining multiple columns and showing as one in searchpane

randomguy102randomguy102 Posts: 3Questions: 1Answers: 0

Link to test case: https://jsfiddle.net/8013naxr/
Debugger code (debug.datatables.net):
Error messages are shown:
Description of a problem: Hi guys,
I'm trying to create this system so that I can show 4 different column data in one search panel at the top like a one longer table.
Looking for SearchPanes to render all referees and combine totals, then display them as a 1 column.

I tried storing all of them in a new column and splitting them with "," but that didn't work as expected. I'm assuming I'm missing a simple point but I couldn't figure out which one.

Any ideas?

Thanks in advance.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    I'm not sure what you mean by one search panel for 4 different columns. It might be worth looking at SearchPanes , this is the basic example. Is that the kind of thing you're after?

    Colin

  • randomguy102randomguy102 Posts: 3Questions: 1Answers: 0

    Thank you for your answer Colin.

    Yes Iā€™m looking to use it with SearchPanes similar to the example.

    But additionally I would like to merge 4 different columns from table in a 1 SearchPanes column (i.e only one SearchPanes column for Referee which will gather results from Referee and also Assistant Referee,Referee Backup,Assistant Backup all together).

  • kthorngrenkthorngren Posts: 21,337Questions: 26Answers: 4,954

    Possibly you could use columns.render to take the 4 columns and render the data into an array in another column hidden using `-option columns.visible. See this column rendering example.

    The use this example to show the array values from the hidden column in SearchPanes.

    Kevin

  • kthorngrenkthorngren Posts: 21,337Questions: 26Answers: 4,954
    edited July 2023

    I just noticed you have a test case. I updated with my above steps.
    https://jsfiddle.net/gmupftwv/1/

    Note I added a column in HTML too.

    Kevin

  • kthorngrenkthorngren Posts: 21,337Questions: 26Answers: 4,954
    Answer āœ“

    Actually you don't need a hidden column. You can generate the orthogonal data in the referee column. For example:
    https://jsfiddle.net/zjvge3nd/

    Kevin

  • randomguy102randomguy102 Posts: 3Questions: 1Answers: 0

    Thanks a lot the last one worked great.

Sign In or Register to comment.