How to filter by content in a column ignoring part of the content
How to filter by content in a column ignoring part of the content
nickog3d
Posts: 4Questions: 0Answers: 0
Is there a way to mark part of cells' content as not searchable? I am successfuly using the bSearchable feature but I need to display more info in same cell.
Something like:
[code]John Doe General Manager[/code]
I am thinking of appending content from other cell into this one( "Position" in same cell with "Name"). But I fear that when searching for part of a name, users may find results related to the position instead.
Any ideas how I can achieve this? I've been looking around but could not find anything similar.
Something like:
[code]John Doe General Manager[/code]
I am thinking of appending content from other cell into this one( "Position" in same cell with "Name"). But I fear that when searching for part of a name, users may find results related to the position instead.
Any ideas how I can achieve this? I've been looking around but could not find anything similar.
This discussion has been closed.
Replies
[code]
//copy position into name cell
$('#DataTables_Table_0').find('tr').each(function(e){
if(e!=0){
var h = $(this).find('.views-field-title');
var t = h.html();
h.html(t + "
" + $(this).find('.views-field-field-job-title').html() + "");
}
});
[/code]
The other option is to use mDataProp (and soon mRender - post on that coming up) to give data back specifically for the filter - see: http://datatables.net/blog/Orthogonal_data
Allan