Combining multiple columns and showing as one in searchpane
Combining multiple columns and showing as one in searchpane
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
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
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).
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
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
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
Thanks a lot the last one worked great.