Happy Evening All,
Following is the code used to create, edit and delete inside a datatable. Looking at adding refresh option to the page/table every time when create button is used. Tried following code no result, any help would be grateful.
Code used to create:
var table = $('#issue_manager').DataTable( {
dom: 'Bfrtip',
ajax: 'DataTablesEditor/php/table.issue_manager.php',
columns: [
{
"data": "iss_no"
},
{
"data": "iss_summary"
},
{
"data": "iss_description"
},
{
"data": "iss_staus"
},
{
"data": "iss_raised_by"
},
{
"data": "iss_raised_by"
},
{
"data": "iss_last_update"
},
{
"data": "iss_assigned"
}
],
select: true,
lengthChange: false,
buttons: [
{ extend: 'create', editor: editor },
{ extend: 'edit', editor: editor },
{ extend: 'remove', editor: editor }
]
} );
Option 1
$(document).on('click', '#refreshdates', function(dn) {
$('#issue_manager').DataTable().ajax.reload();
});
$(document).on('click', '#cleardates', function(dn) {
$('#startdate').val("");
$('#enddate').val("");
$('#issue_manager').DataTable().ajax.reload();
});
Option 2
$('#issue_manager').DataTable().ajax.reload();
Also, I am not sure on how and where to place this code, so that it will get execute when 'create' button is used.