Import problem in Editor
Import problem in Editor

Hello,
Description of problem:
Description of problem:
Datatables works well with the following code.
However, I would like to test Editor but I cannot import the data, clarification made that I declare the file dataTables.editor.min.js
Could you tell me how to modify my code to be able to test Editor?
Thank you.
Code:
var dataSet = [
["RDC", "T1", "T1-1", "32,5", "28", "", "875", "27"],
["RDC", "T1", "T1-2", "25", "25", "", "795", "28"],
["RDC", "T1", "T1-3", "28,5", "22", "", "775", "27"],
["RDC", "T1", "T1-4", "28,5", "8", "", "750", "26"],
["RDC", "T2", "T2-1", "42", "17", "", "925", "22"],
["1", "T1", "T1-5", "32,5", "", "", "750", "23"],
["1", "T1", "T1-6", "28,5", "", "", "710", "25"],
["1", "T1", "T1-7", "28,5", "", "", "710", "25"],
["1", "T1", "T1-8", "28,5", "", "", "710", "25"],
["1", "T1", "T1-9", "15,75", "", "", "475", "30"],
["2", "T2", "T2-2", "45", "", "13", "950", "21"],
["2", "T1", "T1-10", "38", "", "10", "825", "22"],
["2", "T1", "T1-11", "38", "", "10", "825", "22"],
["2", "T1", "T1-12", "38", "", "10", "825", "22"],
["2", "T1", "T1-13", "15,75", "", "", "475", "30"]
];
$(document).ready(function() {
$('#example').DataTable({
responsive: true,
data: dataSet,
dom: 'Bfrtip',
lengthChange: false,
searching: false,
paging: false,
info: false,
colReorder: true,
buttons: [
{
extend: 'excelHtml5',
footer: true,
className: 'red'
},
{
extend: 'pdfHtml5',
footer: true
},
{
extend: 'print',
text: 'Imprimer',
footer: true,
},
],
select: true,
columns: [{
title: "Étage"
},
{
title: "Type"
},
{
title: "Numéro"
},
{
title: "Superficie",
render: $.fn.dataTable.render.number(' ', ',', 2, '', ' m²')
},
{
title: "Terrasse",
render: $.fn.dataTable.render.number(' ', ',', 2, '', ' m²')
},
{
title: "Mezzanine",
render: $.fn.dataTable.render.number(' ', ',', 2, '', ' m²')
},
{
title: "Loyer",
render: $.fn.dataTable.render.number(' ', ',', 0, '', ' €')
},
{
title: "Loyer par m²",
render: $.fn.dataTable.render.number(' ', ',', 2, '', ' €')
}
]
});
});
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
To get started, download the package from the download page and follow the install instructions.
Your data also needs a unique ID so the rows can be identified, see example here.
Colin