How to add a individual column filtering?

How to add a individual column filtering?

BernardoLimaBernardoLima Posts: 20Questions: 0Answers: 0
edited March 2013 in Editor
I already have a table and here's the current code:

[code]
var editor; // use a global for the submit and return data rendering in the examples

$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
"ajaxUrl": "php/browsers.php",
"domTable": "#example",
"fields": [
{
"label": "Nome",
"name": "nome",
"type": "text"
},
{
"label": "Email",
"name": "email",
"type": "text"
},
{
"label": "Administrador",
"name": "administrador",
"type": "select",
"ipOpts": [
{
"label": "Sim",
"value": "Sim"
},
{
"label": "N\u00e3o",
"value": "N\u00e3o"
}
]
},
{
"label": "Senha",
"name": "senha",
"type": "password"
}
]
} );


$('#example').dataTable( {
"sDom": "<'row-fluid'<'span6'T><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
"sAjaxSource": "php/browsers.php",
"aoColumns": [
{ "mData": "nome" },
{ "mData": "email" },
{ "mData": "administrador" }
],
"oTableTools": {
"sRowSelect": "multi",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor },
{ "sExtends": "editor_edit", "editor": editor },
{ "sExtends": "editor_remove", "editor": editor }
]
}
} );
} );
[/code]

Replies

  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    There are many ways of doing it - all basically involving using fnFilter . Here is one example of how it might be done: http://datatables.net/release-datatables/examples/api/multi_filter.html

    Allan
  • BernardoLimaBernardoLima Posts: 20Questions: 0Answers: 0
    edited March 2013
    Hello allan,

    I've tried to insert the code from the example and this is what I get:

    Before inserting the code:
    http://i.imgur.com/kRjJbEM.png

    After:
    http://i.imgur.com/c2HtqVx.png

    PS: I have modified Editor/examples/bootstrap.html to my needs, as you can see if I do not insert any new buttons or customizations (like column filtering,etc), it works properly, but if I try to insert something new it collapses.
This discussion has been closed.