Updating and deleting???
Updating and deleting???
I've got a couple different functions in my datatables that work if I remove one or the other. The following code will update my database after adding and deleting:
[code]
$(document).ready( function () {
var oTable = $('#example').dataTable().makeEditable({
sUpdateURL: "UpdateData.cfm",
sAddURL: "AddData.cfm",
sDeleteURL: "DeleteData.cfm"
});
} );
[code]
...and this will refresh my page IF I remove the above code:
[code]
var oTable;
$(document).ready(function() {
oTable = $('#example').dataTable();
/* Re-draw the table - you wouldn't want to do it here, but it's an example :-) */
oTable.fnDraw();
} );
[/code]
How can I combine these functions together so that I can add, delete and update my database AND have the page refresh afterwards? Thanks.
[code]
$(document).ready( function () {
var oTable = $('#example').dataTable().makeEditable({
sUpdateURL: "UpdateData.cfm",
sAddURL: "AddData.cfm",
sDeleteURL: "DeleteData.cfm"
});
} );
[code]
...and this will refresh my page IF I remove the above code:
[code]
var oTable;
$(document).ready(function() {
oTable = $('#example').dataTable();
/* Re-draw the table - you wouldn't want to do it here, but it's an example :-) */
oTable.fnDraw();
} );
[/code]
How can I combine these functions together so that I can add, delete and update my database AND have the page refresh afterwards? Thanks.
This discussion has been closed.
Replies
If you have any suggestions on how to improve the DataTables documentation then I'm all ears!
Ultimately I will be looking at writing a editing plug-in for DataTables that will form part of the core project and thus get documented as such, but part of the issue with that is that there are about a million ways to present the editing and its all heavily dependent on the server-side environment as well - something I absolutely do not want to dictate.
Allan