filter html by span tag inside td in datatables
filter html by span tag inside td in datatables
jdelcallar
Posts: 1Questions: 0Answers: 0
have an external dropdown form which have a values of correct and incorrect, whenever incorrect is chosen a ajax post will run and will generate a span inside td for incorrect values. What I need is that datatables should filter out incorrect by checking span inside td.
HTML:
[code]
Correct
Incorrect
[/code]
//Data Tables
Word
Cat
Dog
Dogr
JS:
[code]$(document).ready(function(){
var dtTable = $('#data').dataTable( {
"sDom": '<"H"lr>t<"F"ip>',
"bSort": false,
"bAutoWidth": false,
"iDisplayStart": 0,
"iDisplayLength": 25,
"bProcessing": true,
"sPaginationType": "full_numbers",
"bJQueryUI": true,
});[/code]
[code]$("#filter").change(function(){
//Ajax Post request to check spelling
});
});[/code]
On #filter change, when incorrect is chosen it should only filter rows with span class wrong-spelling
HTML:
[code]
Correct
Incorrect
[/code]
//Data Tables
Word
Cat
Dog
Dogr
JS:
[code]$(document).ready(function(){
var dtTable = $('#data').dataTable( {
"sDom": '<"H"lr>t<"F"ip>',
"bSort": false,
"bAutoWidth": false,
"iDisplayStart": 0,
"iDisplayLength": 25,
"bProcessing": true,
"sPaginationType": "full_numbers",
"bJQueryUI": true,
});[/code]
[code]$("#filter").change(function(){
//Ajax Post request to check spelling
});
});[/code]
On #filter change, when incorrect is chosen it should only filter rows with span class wrong-spelling
This discussion has been closed.