Can't figure out the syntax for splitting arrays in source data

Can't figure out the syntax for splitting arrays in source data

pmconsultingpmconsulting Posts: 36Questions: 11Answers: 0

Link to test case: https://bongo.cc/spud3/spud/
Debugger code (debug.datatables.net): n/a
Error messages shown: n/a
Description of problem:

Several columns of my HTML data source may contain more than one value in a cell with a comma as a separator. I need the searchPanes to split these strings at the comma and handle each substring accordingly.

The manual provides this syntax:
{
render: {
_: '[, ].name',
sp:'[].name'
},
searchPanes: {
orthogonal:'sp'
}
}

But the manual provides no examples of how to do this for an HTML formatted data source. I've guessed at several placements among the columnDefs, but none have worked. Please help!

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,425Questions: 26Answers: 4,794
    Answer ✓

    I didn't dig through all the rows but I didn't see any cells that have data with commas. Your page loads very slowly for me so I built a simple example that has a column with commas and used your code in your test case. The code does split the at the commas to build the list of search terms..
    http://live.datatables.net/povojuyo/1/edit

    Either tell us specifically what to look at in your test case or update mine or create a new one that shows the problem.

    Kevin

  • pmconsultingpmconsulting Posts: 36Questions: 11Answers: 0

    Thank you VERY MUCH! I was able to get it working: https://bongo.cc/spud2/rpe-all-products-simple/

    But I have a stray '0' at the bottom of each search pane. I'm not sure where that's coming from.

Sign In or Register to comment.