Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82628

Retrieve Distinct Values from Datatable Columns and populate Select Dropdown

$
0
0

I have dilemma and need guidance. I have 2 Select Dropdowns. One for facilities and the other for patients that get populated in my Laravel 8 website. I use datatables to populate my records for facilities and patients columns. I want to know how to do the following. My first facility select dropdown on the onchange action should look for the disctinct values and populate my patient select dropdown from data within the Datatables Patients column and get its distinct values as its options.

I want to put the code on the onchange of the first Facilities select dropdown.

//facility select right below TBR if not function first section
$('#facilitySelect').on('change', function() {
table.column($(this).data('column'))
.search($(this).val())
.draw();
});

How do I do this?


Viewing all articles
Browse latest Browse all 82628

Latest Images



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>