I'm not being able to filter when I use a function on column render

I'm not being able to filter when I use a function on column render

arielfmdparielfmdp Posts: 6Questions: 2Answers: 1

Here is some sample code, it's just a simple portion of code to illustrate what I mean

$(document).ready(function() {
$('#example').dataTable( {
"ajax": "data/objects.txt",
"columns": [
{ "data": "name",

          "render": function(data,type,full){                          
            //I need to display the field "safe_name" only if "name" is empty or null
            //BUT I also need to be able to filter by that column, no matter what field
            // had been used to fill it
            return (data == "" || data == null) ? full.safe_name : data

          }
        },
        { "data": "position" },
        { "data": "office" },
        { "data": "extn" },
        { "data": "start_date" },
        { "data": "salary" }
    ]
} );

} );

I need to display the field "safe_name" only if "name" is empty or null
BUT I also need to be able to filter by that column, no matter what field
had been used to fill it. The issue is that I can only filter like if it was filled just with "name" field

I've also tried a function on data, but I couldn't get what I need, it was the same problem.

I hope someone can help, or give some clue...
Thank you very much

Oh, and congratulations !!! to Allan for the Nominet Internet Awards !!
I think it's a real very important achieve.

Best regards,
Ariel

This discussion has been closed.