Topic: plugin mdb editor 4.7.6
Gerard Fossoul pro asked 6 years ago
Hello, buy the plugin "MDB-Editor_4.7.6", I have the "Big Bundle: MDB Pro + All Templates". When I copy the plug in my web, I lose all the style of before, and above, the plugin does not work. Can you indicate how to put the plugin step by step?
Gerard Fossoul pro answered 6 years ago
how to use buttons: ["pdf"] in table with mdb editor?
i put this code in $('#dtBasicExample').mdbEditor({});
dom: 'B<"clear">lfrtip', buttons: [ { extend: 'pdfHtml5', title: 'Clients', }, { extend: 'copyHtml5', text: 'Copiar', title: 'Clients', }, { extend: 'excelHtml5', title: 'Clients', }, { extend: 'csvHtml5', title: 'Clients', }, { extend: 'print', title: 'Clients', }, { extend: 'colvis', text: 'Col. Vis.', } ] });
Piotr Glejzer staff answered 6 years ago
We don't support button extensions from datatable in our docs. But if you want to do this you can use this code and it will be work.
You have to have extensions like that.
<script type="text/javascript" src="../js/addons/datatables.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.6/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.flash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.print.min.js"></script>
<script type="text/javascript" src="../js/addons/mdb-editor.js"></script>
and initiate functions like this ( there is a exmalpe with data and columns for JSON file, you don't have to do this) :
$(document).ready(function () {
$('#example').DataTable({
data: myJasonData.responseJSON.data,
columns: myJasonData.responseJSON.columns,
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('#example').mdbEditor({
modalEditor: true
});
});
$('.dataTables_length').addClass('bs-select');
If you will do that there will show buttons like that.
https://ibb.co/CPVr2nd
and if you will editing something it will work
https://ibb.co/LQJrjTW
and screen from pdf
https://ibb.co/Q6kBNtS
Best,
Piotr
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.7.5
- Device: pc
- Browser: chrome
- OS: win10
- Provided sample code: No
- Provided link: No
Gerard Fossoul pro commented 6 years ago
Solved!!!! thanks