How to retrieve data before window unload
How to retrieve data before window unload
Hello,
I use dataTable 1.7.6 with jeditable.
I want to retrieve the data with fnGetData() before the window unload.
I tried :
[code]
$(window).unload(function() {
var sTab = $(oTable.fnGetData()).serializeArray().getJSON();
alert(sTab);
$('#iptAddMajMember').val(sTab);
});
[/code]
but oTable.fnGetData() is empty.
Thanks in advance.
I use dataTable 1.7.6 with jeditable.
I want to retrieve the data with fnGetData() before the window unload.
I tried :
[code]
$(window).unload(function() {
var sTab = $(oTable.fnGetData()).serializeArray().getJSON();
alert(sTab);
$('#iptAddMajMember').val(sTab);
});
[/code]
but oTable.fnGetData() is empty.
Thanks in advance.
This discussion has been closed.
Replies
In the click event function of input submit, I convert data on json and put into the value of input html element.
[code]
$("#iptMajMembreCesc").click(function() {
var sTab = JSON.stringify(oTable.fnGetData());
$('#iptAddMajMember').val(sTab);
return $('#iptAddMajMember').submit();
});
[/code]