Switching from DataTables only to Editor

Switching from DataTables only to Editor

colincolin Posts: 15,240Questions: 1Answers: 2,599

@mokemonster - for some reason the spam filter trapped your message, and I can't release it - so posting here as an alternative!

I set up DataTables using Ajax and got it [working](https:// ericaaugustine.com/icons-dt/iconfont-cheatsheet.html "working") (thanks Kevin!). Now I am trying to make it work with Editor on the 15 day trial. I have the database set and have loaded my JSON data, and everything looks good BUT all the customizations I made to my table previously no longer work. I know that you can't initialize the table twice which is what I think is the reason my existing code no longer works, but with the exception of the fixed header (which I learned can be called from the API with table.fixedHeader.enable( true ); ) I don't understand how to re-phrase all of my previous code so it'll work with Editor.

This is what I had for DataTables. (I know I don't need to call ajax anymore):

<script>
$(document).ready(function() {
$('#icnTable').DataTable( {
"fixedHeader": true,
"ajax": "icon-list.json",
"bPaginate": false,
"dom": '<"top"fi>rt',
"order": [[ 1, "desc" ]],
"rowDefs": [
{ "sClass": "header-row", "aTargets": [ 0 ] }
],
"columnDefs": [
{ "sClass": "code", "aTargets": [ 1 ] },
{ "sClass": "icon-column", "aTargets": [ 0 ] }
],

"columns": [
{ "data": "Icon", render: function (data, type, row) {
return '<button class="dvi-2x ico-btn ' + row.Class + '" data-clipboard-text="' + data + '"></button>';
}
},
{ "data": "Class" },
{ "data": "Keywords" },
{ "data": "Category" },
{ "data": "Unicode" }
]
} );
} );
</script>

How can I get all of these same customizations to work in Editor?
DataTables only version: https://ericaaugustine.com/icons-dt/iconfont-cheatsheet.html
Editor version: https://ericaaugustine.com/icons/ less

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    You can just leave the DataTables initialisation the same, with just adding the button definitions for the editing controls. If you look at this example here, without Editor, the table definition would just have the buttons section removed.

    Colin

    p.s. I worked out what was causing the issue - the forum software doesn't like that party icon you used!! Very bizarre.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    This is in reference to this question.

    Allan

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Closing, using the original as the reply place!

This discussion has been closed.