sType HTML and Column Filter plugin
sType HTML and Column Filter plugin
alussc
Posts: 18Questions: 0Answers: 0
We use DataTables with the Column Filtering plugin (http://code.google.com/p/jquery-datatables-column-filter/) an I'ld like to define the sType for one column because there's a inside the and I'ld like DataTables to ignore the HTML. Where to define the "sType": "html"?
This our code:
[code]
.columnFilter({aoColumns:[
{ "bSortable": false },
null,
{ type:"select", sSelector: "#Filter1", values: ['Option 1', 'Option 2', 'Option 3'], selected: 'Option2' },
{ "bSortable": false },
{ type:"select", sSelector: "#Filter2", values: ['Option 1', 'Option 2', 'Option 3']},
{ type:"select", sSelector: "#Filter3", values: ['Option 1', 'Option 2', 'Option 3']},
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ type:"select", sSelector: "#Filter4", values: ['Option 1', 'Option 2', 'Option 3']}
]}
);
[/code]
This our code:
[code]
.columnFilter({aoColumns:[
{ "bSortable": false },
null,
{ type:"select", sSelector: "#Filter1", values: ['Option 1', 'Option 2', 'Option 3'], selected: 'Option2' },
{ "bSortable": false },
{ type:"select", sSelector: "#Filter2", values: ['Option 1', 'Option 2', 'Option 3']},
{ type:"select", sSelector: "#Filter3", values: ['Option 1', 'Option 2', 'Option 3']},
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ type:"select", sSelector: "#Filter4", values: ['Option 1', 'Option 2', 'Option 3']}
]}
);
[/code]
This discussion has been closed.
Replies
{
column_number: 4,
column_data_type: "html",
html_data_type: "text",
filter_default_label: "Select tag"
}
no need to specify filter_type: "filter_type" because it the default value docs : https://github.com/vedmack/yadcf/blob/master/jquery.dataTables.yadcf.js
My actual solution is to load the data twice: One time for viewing (with span), one time for filtering (no span). Maybe someone else got a smarter solution with the Column Filter plugin?