form.serialize only retrieves values of current page
form.serialize only retrieves values of current page
Currently I have this code to get my values from the datatable:
[code]
$(this).on('click', '#AddSelectedProjectCandidateReportRecipientsSubmitButton', function (e) {
e.preventDefault();
var form = $('#AddProjectCandidateReportRecipientsForm');
ShowDetailSaveDialog();
$.ajax({
url: form.attr('action') + '/' + form.attr('data-project-candidate-id'),
type: 'POST',
data: form.serialize(),
success: function (data) {
HideDetailSaveDialog();
$('#AddProjectCandidateReportRecipientsDialog').dialog('close');
RefreshProjectCandidateReportRecipients(form.attr('data-project-candidate-id'));
return false;
},
error: function (x, y, z) {
alert(x.responseText);
}
});
});
[/code]
It only gives me the values of the current page
I already tried a milion ways to try get all data from the datatable with fnGetData / fnGetNodes /... but when I attempt to retrieve my datatable I think he's not finding it. I tried with $(table).dataTable, $("#myform").dataTable and some more but nothing works.
Anyone has a solution for me?
Thanks in advance.
[code]
$(this).on('click', '#AddSelectedProjectCandidateReportRecipientsSubmitButton', function (e) {
e.preventDefault();
var form = $('#AddProjectCandidateReportRecipientsForm');
ShowDetailSaveDialog();
$.ajax({
url: form.attr('action') + '/' + form.attr('data-project-candidate-id'),
type: 'POST',
data: form.serialize(),
success: function (data) {
HideDetailSaveDialog();
$('#AddProjectCandidateReportRecipientsDialog').dialog('close');
RefreshProjectCandidateReportRecipients(form.attr('data-project-candidate-id'));
return false;
},
error: function (x, y, z) {
alert(x.responseText);
}
});
});
[/code]
It only gives me the values of the current page
I already tried a milion ways to try get all data from the datatable with fnGetData / fnGetNodes /... but when I attempt to retrieve my datatable I think he's not finding it. I tried with $(table).dataTable, $("#myform").dataTable and some more but nothing works.
Anyone has a solution for me?
Thanks in advance.
This discussion has been closed.
Replies
Allan
Thanks for replying, I already tried this before and the sData was empty...
[code]
$(this).on('click', '#AddSelectedProjectCandidateReportRecipientsSubmitButton', function (e) {
e.preventDefault();
oTable = $(table).dataTable();
var sData = oTable.serialize();
var form = $('#AddProjectCandidateReportRecipientsForm');
ShowDetailSaveDialog();
$.ajax({
url: form.attr('action') + '/' + form.attr('data-project-candidate-id'),
type: 'POST',
data: sData,
success: function (data) {
HideDetailSaveDialog();
$('#AddProjectCandidateReportRecipientsDialog').dialog('close');
RefreshProjectCandidateReportRecipients(form.attr('data-project-candidate-id'));
return false;
},
error: function (x, y, z) {
alert(x.responseText);
}
});
});
[/code]
Is there something wrong with this code?
> $(table).dataTable();
with:
[code]
$(table).dataTable().$('tr');
[/code]
Allan