How to remove rows before serialize?
How to remove rows before serialize?
How does one remove rows where a certain field (textbox) within the row is empty before serializing the DataTable?
I've tried a several methods using jQuery and they either don't work on paginated rows (which are not loaded dynamically) or it fails completely.
This seems to be the most logical.
[code]
$('input[name$="Number"]').each(function() {
if ($(this).val() == "") {
var row = $(this).closest('tr'); // Also tried .parent(); and .parent('tr'); etc.
oTable.fnDeleteRow(row);
}
});
var sData = $('input[value]', oTable.fnGetNodes()).serialize();
[/code]
Thanks for looking.
I've tried a several methods using jQuery and they either don't work on paginated rows (which are not loaded dynamically) or it fails completely.
This seems to be the most logical.
[code]
$('input[name$="Number"]').each(function() {
if ($(this).val() == "") {
var row = $(this).closest('tr'); // Also tried .parent(); and .parent('tr'); etc.
oTable.fnDeleteRow(row);
}
});
var sData = $('input[value]', oTable.fnGetNodes()).serialize();
[/code]
Thanks for looking.
This discussion has been closed.