Search code examples
javascriptjqueryyadcf

How to disable auto sorting of yadcf filter options?


I am using jQuery plugin yadcf plugin . first, I've defined an array all_serve_products = ["NOS","URS","NVS","NBS","CNS","NEFS"], the filter working fine except that its order are changed.

Is there any way to keep the options of filter show the original order of array ?

 var all_serve_products = ["NOS","URS","NVS","NBS","CNS","NEFS"];
 var Statistic = $('#statistic').DataTable();
 yadcf.init(Statistic,[
  {column_number : 7, data: all_serve_products, filter_default_label: "Products"}
]);

enter image description here


Solution

  • You should use sort_as: 'none' for that filter, read docs for more...