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: 2Questions: 1Answers: 0
edited October 12 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>

Answers

  • cms1cms1 Posts: 2Questions: 1Answers: 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: 14,086Questions: 25Answers: 3,322

    Does this example help?

    Kevin

Sign In or Register to comment.