How do you show a json array as multiple options in searchpanes? (pictures included)

How do you show a json array as multiple options in searchpanes? (pictures included)

cms1cms1 Posts: 11Questions: 4Answers: 0
edited October 2021 in SearchPanes

Hello, I've looked up all I can but I can't seem to figure this out:

How can I turn this:

Into this:

Here an excerpt of the array in JSON:

nameOfDocument":"Ventilation of a Neonate",
authorDepartment":["Paediatrics Committee","Respiratory Therapy"]

This is the datatables script I'm using:

<script type="text/javascript">
  $(document).ready(function() {
      $('#policies').DataTable({
        "ajax": 'data.txt',
        "columns": [
            { "data": "nameOfDocument" },
            { "data": "authorDepartment[, ]" },
        ],
        "searchPanes": {
            cascadePanes: true,
        },

        dom: 'Pflrtip'
      });
  });
</script>

This question has an accepted answers - jump to answer

Answers

  • cms1cms1 Posts: 11Questions: 4Answers: 0

    If anyone can point me towards a datatables resource page I'd appreciate it, I feel like I've tried them all to no avail

  • kthorngrenkthorngren Posts: 21,167Questions: 26Answers: 4,921
    Answer ✓

    Does this example help?

    Kevin

Sign In or Register to comment.