jquery - Datatables filtering to be dynamic between columns -


when using column filtering in datatables, want once first column filter chosen , resulting dataset rendered, other columns filters refined shown.

see example: https://www.datatables.net/examples/api/multi_filter_select.html

if choose 'developer' position filter, location filter should refine 4 locations remaining. instead show locations original dataset. there way make refine them down each filter applied?

try hide options in drawcallback

drawcallback: function() {   var api = this.api();   let data = api.rows({     filter: 'applied'   }).data();   $.each($(api.table().footer()).find("select"), function(colindex) {     var currdata = data.map(function(cols) {       return cols[colindex];     });     $.each($(this).find("option"), function() {       if (currdata.indexof($(this).text()) != -1 || $(this).text() == '')         $(this).attr("disabled", false).show();       else         $(this).attr("disabled", true).hide();     })   }); } 

fiddle


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -