sType HTML and Column Filter plugin

sType HTML and Column Filter plugin

alusscalussc Posts: 18Questions: 0Answers: 0
edited November 2013 in DataTables 1.9
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]

Replies

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67
    not sure about the sType, but you can try with my plugin http://yadcf-showcase.appspot.com/DOM_source.html (take a look at the fifth column: Tags), you can use the column_data_type: "html",html_data_type: "text"
  • alusscalussc Posts: 18Questions: 0Answers: 0
    Looks interesting but it seems like using a sledgehammer to crack a nut :) . Isn't there a simpler solution? Unfortuantely it's not possible to define it like: [quote]"sType": "html", type:"select", ...[/quote]
  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67
    Well, actually the lack of html support in that plugin was the trigger for me to write down my own plugin :)

    {
    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
  • alusscalussc Posts: 18Questions: 0Answers: 0
    Ok, thanks for the input!
    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?
This discussion has been closed.