/* * Editor client script for DB table DirectoryListings * Created by http://editor.datatables.net/generator */ (function($){ $(document).ready(function() { var listing_editor = new $.fn.dataTable.Editor( { ajax: 'php/table.DirectoryListings.php', table: '#DirectoryListings', fields: [ { "label": "Listing Type:", "name": "DirectoryListings.DirTypeID", "type": "select", }, { "label": "Listing Name:", "name": "DirectoryListings.ListingName" } ] } ); var listing_table = $('#DirectoryListings').DataTable({ dom: 'Bfrtip', ajax: 'php/table.DirectoryListings.php', "pageLength": 50, columns: [ { "data": "DirectoryTypes.TypeName" }, { "data": "DirectoryListings.ListingName" } ], buttons: [ { extend: 'create', editor: listing_editor }, { extend: 'edit', editor: listing_editor }, { extend: 'remove', editor: listing_editor } ] }); listing_table.column(0).search("School", true, false).order([1, 'asc']).draw(); // Activate an inline edit on click of a table cell $('#DirectoryListings').on('click', 'tbody td:not(:first-child)', function (e) { listing_editor.inline(this); }); }); }(jQuery));