I see this filtering yadcf demo for Datatables: Live Demo
You can filter table by tags but you can't click on Tag1
or Tag2
for use them like filtering table results and return only rows that have Tag1
or Tag2
.
is possible use tag inside table like a cliccable tags filters mode?
Which code must edit/add in jquery.datatables.yadcf.js?
In the demo above this is part of code. How implement my feature request in column_number: 4
or tag column?
$(document).ready(function () {
'use strict';
//----------------------------------------------
// this is the code for column tag
//----------------------------------------------
oTable = $('#example').dataTable({
"bJQueryUI": true,
"bStateSave": true
}).yadcf([{
......
......
{
column_number: 4,
select_type: 'select2',
select_type_options: {
width: '150px'
placeholder: 'Select tag',
allowClear: true // show 'x' (remove) next to selection inside the select itself
},
column_data_type: "html",
html_data_type: "text",
filter_reset_button_text: false // hide yadcf reset button
}]);
SyntaxHighlighter.all();
Which of these parameters must be edited?
column_number
filter_type
custom_func
data
column_data_type
text_data_delimiter
html_data_type
filter_container_id
filter_default_label
filter_reset_button_text
enable_auto_complete
sort_as
sort_order
date_format
ignore_char
filter_match_mode
select_type
select_type_options
case_insensitive
filter_delay
It can be achieved in the following ways
1) call this code upon page ready (note that your selector probably will be different)
$('#example').on('click',".label.lightblue", function () {
yadcf.exFilterColumn(oTable, [[4, $(this).text()]]);
});
2) attach onclick event to your "tags" , something like this onclick="yadcf.exFilterColumn(oTable, [[4, 'Tag1']]);"