search need to target by particular class name
search need to target by particular class name
muako
Posts: 9Questions: 1Answers: 0
.search
how to target by specific class name? My td
has multiple span
tag but i would like to target one tag as myTarget, so Manager
will be filtered.
$('#example').DataTable( {
var column = this;
$('.dropdown_class') .on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column.search( val ? '^'+val+'$' : '', true, false ).draw();
} );
} );
} );
When i am using above method, its conflict and its not match between td
because td
match newline or separate word.
Example:
<tr>
<td>Garrett Winters</td>
<td>Director <span class="myTarget">Manager</span><span class="noTarget">Officer</span></td>
<td>Edinburgh</td>
<td>63</td>
<td>2011/07/25</td>
<td>$5,300</td>
1.</tr>
Replies
Orthogonal data might work for your case. In
columns.render
parse thespan
element to extract the string you want for thefilter
operation. Set the Computed values section for an example.Kevin
@kthorngren, thanks answered.