vedmack / yadcf

Yet Another DataTables Column Filter (yadcf)
http://yadcf-showcase.appspot.com/
MIT License
732 stars 285 forks source link
datatables-column-filter datatables-plugin filter filter-types javascript jquery-plugin yadcf

Yet Another DataTables Column Filter - (yadcf)

CDNJS

Description:

This jQuery plug-in allows the user to easily add filter components to table columns, the plug-in works on top of the DataTables jQuery plug-in.

Great news everyone:

I have started working on yadcf2 to support the new DataTables 2! The new showcase page is https://yadcf.web.app/ yadcf 2 will support DT 1 and DT 2, you should use the yadcf.init api to init the filters

Contact/Social:

If you want to ask a question you can post a question on stackoverflow with yadcf tag

If you like my plugin, you can show your appreciation by following me on Twitter / GitHub

Features:

Examples:

DOM source

DOM source with chosen

DOM source with select2

DOM / Multiple columns and tables 1.10.0

AJAX source

AJAX mData (deep)

Multiple tables

Server side source

DOM / Ajax multiple 1.10

Externally triggered filters

Cumulative filtering

Usage:

$(document).ready(function(){
  //Old datatable API (lowercase "D")
  $('#example').dataTable().yadcf([
    {column_number : 0},
    {column_number : 1, filter_type: "range_number_slider", filter_container_id: "external_filter_container"},
    {column_number : 2, data: ["Yes", "No"], filter_default_label: "Select Yes/No"},
    {column_number : 3, filter_type: "auto_complete", text_data_delimiter: ","},
    {column_number : 4, column_data_type: "html", html_data_type: "text", filter_default_label: "Select tag"}]);

  //New datatable API (capital "D")
  var myTable = $('#example').DataTable();

  yadcf.init(myTable, [
    {column_number : 0},
    {column_number : 1, filter_type: "range_number_slider", filter_container_id: "external_filter_container"},
    {column_number : 2, data: ["Yes", "No"], filter_default_label: "Select Yes/No"},
    {column_number : 3, filter_type: "auto_complete", text_data_delimiter: ","},
    {column_number : 4, column_data_type: "html", html_data_type: "text", filter_default_label: "Select tag"}]);
});

Available parameters - being set per column (detailed explanation inside jquery.dataTables.yadcf.js)

Available global parameters - being set per table (detailed explanation inside jquery.dataTables.yadcf.js)

License:

Copyright (c) 2014 Daniel Reznick, released under the MIT license