Edit doesn't work
Edit doesn't work
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
var editor;
$(document).ready(function (){
// editor = new $.fn.dataTable.Editor( {
editor=$("#example").dataTable({
"sAjaxSource":"emp.json",
"display":"envelope",
// "aoColumns":[null,null,
// {
// "mData":null,
// "sDefaultContent":"Edit"
// }],
"aoColumns":[
{ "mData":"name"},
{"mData":"address"},
{
"mDataProp":null,
"sDefaultContent": 'Edit / Delete',
"aTargets":[-1],
"sClass":"center"}
],
// "aoColumnDefs":[{
//
//
// "mDataProp":null,
//
// "sDefaultContent": 'Edit / Delete',
// "aTargets":[-1],
// "sClass":"center"
// }],
////
"aLengthMenu": [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"]], //define pagination dropdown
"iDisplayLength": 10, //define initial size of the pagination
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
$('#example').on('click', 'a.editor_edit', function (e) {
e.preventDefault();
editor.edit(
$(this).parents('tr')[0],
'Edit record',
{ "label": "Update", "fn": function () { editor.submit() } }
);
} );
});
FullName:
Address:
Edit:
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
var editor;
$(document).ready(function (){
// editor = new $.fn.dataTable.Editor( {
editor=$("#example").dataTable({
"sAjaxSource":"emp.json",
"display":"envelope",
// "aoColumns":[null,null,
// {
// "mData":null,
// "sDefaultContent":"Edit"
// }],
"aoColumns":[
{ "mData":"name"},
{"mData":"address"},
{
"mDataProp":null,
"sDefaultContent": 'Edit / Delete',
"aTargets":[-1],
"sClass":"center"}
],
// "aoColumnDefs":[{
//
//
// "mDataProp":null,
//
// "sDefaultContent": 'Edit / Delete',
// "aTargets":[-1],
// "sClass":"center"
// }],
////
"aLengthMenu": [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"]], //define pagination dropdown
"iDisplayLength": 10, //define initial size of the pagination
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
$('#example').on('click', 'a.editor_edit', function (e) {
e.preventDefault();
editor.edit(
$(this).parents('tr')[0],
'Edit record',
{ "label": "Update", "fn": function () { editor.submit() } }
);
} );
});
FullName:
Address:
Edit:
This discussion has been closed.