Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 83164

Edit doesn't work

$
0
0
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="../media/css/demo_page.css"/>
<link rel="stylesheet" href="../media/css/jquery.dataTables_themeroller.css"/>
<link rel="stylesheet" href="../examples_support/themes/smoothness/jquery-ui-1.8.4.custom.css"/>
<link rel="stylesheet" href="../media/css/demo_table.css"/>
<link rel="stylesheet" href="../TableTools/media/css/TableTools.css"/>


<script src="jquery.js"></script>
<script src="jquery.dataTables.js"></script>
<script src="../jquery/dataTables.editor.js"></script>




</head>
<body>
<script>
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": '<a href="" class="editor_edit">Edit</a> / <a href="" class="editor_remove">Delete</a>',
"aTargets":[-1],
"sClass":"center"}
],
// "aoColumnDefs":[{
//
//
// "mDataProp":null,
//
// "sDefaultContent": '<a href="" class="editor_edit">Edit</a> / <a href="" class="editor_remove">Delete</a>',
// "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() } }
);
} );



});



</script>

<div id="dt_example">
<div id="container">
<table id="example">
<thead>
<tr>
<th>FullName:</th>
<th>Address:</th>
<th>Edit:</th>

</tr>
</thead>
<tbody>
</tbody>
</table>


</div>
</div>
</body>
</html>

Viewing all articles
Browse latest Browse all 83164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>