Using Editor for the first time in a WordPress site

Using Editor for the first time in a WordPress site

hnorman138hnorman138 Posts: 12Questions: 5Answers: 0

This is my first time using datatables at all, let alone Editor, but I've been tasked with making these existing datatables editable. This is all taking place on a WordPress site and I've had some headaches in the past getting the tables themselves to work on this specific wordpress site. I'm hoping for some tips on how to get editor working on these tables so that rows can be deleted or edited and the database would update from the edits. One thing to note is that all of my data, including table headers, is loaded from a database and not called explicitly in the code.

I'm just looking for the best way to get this table editable and the delete option for rows for someone who is very much a novice and for this to work in a WP environment.

The tables are at testing.uwsinc.net/dashboardtest and here is the code:

<head>
<script type="text/javascript"   src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript"   src="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>
<script type="text/javascript"   src="https://cdn.datatables.net/buttons/1.3.1/js/dataTables.buttons.min.js"></script>
<script type="text/javascript"   src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script type="text/javascript"   src="https://cdn.datatables.net/buttons/1.3.1/js/buttons.colVis.min.js"></script>
<script type="text/javascript"   src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.27/build/pdfmake.min.js"></script>
<script type="text/javascript"   src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.27/build/vfs_fonts.js"></script>
<script type="text/javascript"   src="https://cdn.datatables.net/buttons/1.3.1/js/buttons.html5.min.js"></script>
<script type="text/javascript"   src="https://cdn.datatables.net/plug-ins/1.10.15/filtering/row-based/range_dates.js"></script>
</head>
<body>

<label style="font-weight:bold;">Select the table you would like to view:
</label></br>
<select name='tables' id='select-tables'>
<option value="mytable">Survey Test Table</option>
<option value="mytableSurvey">Survey Only</option>
</select>
</br>


<script type="text/javascript">
(function($) {
$(document).ready(function() {

$('#mytable').DataTable({
dom: 'Bfrtip',
  buttons: [
    'copy', 'excel', 'pdf', 'colvis'
]
});


$('#mytableSurvey').DataTable({
dom: 'Bfrtip',
buttons: [
    'copy', 'excel', 'pdf', 'colvis'
]
});
$('.dataTable').wrap('<div class="dataTables_scroll" />');


$(document).on('change' , '#select-tables', function(){
var table = $(this).val();
$('#' + table +'_wrapper').show();
$('[id$="_wrapper"]').not('#' + table +'_wrapper').hide();
});
$("#select-tables").trigger("change");

});
}(jQuery));
</script>

Answers

  • allanallan Posts: 61,821Questions: 1Answers: 10,127 Site admin

    Hi,

    Thanks for your question. The first thing to say is that it doesn't look like you are loading Editor. The trial can be downloaded from its download page and you can include the Editor CSS and JS just as you would with any media files.

    The getting started guide is probably the next stop.

    I haven't used WordPress much myself, so I can't really say much about it I'm afraid, but I know you can include JS and CSS just as normal, so it should be possible to use Editor okay there.

    Allan

This discussion has been closed.