Create multiple blank rows
Create multiple blank rows
karlie
Posts: 83Questions: 17Answers: 0
Hi, I have created a button that creates a new row, without Editor appearing, and it works fine:
//Create Empty
new $.fn.dataTable.Buttons(table, [{
extend: "create",
text: "Create Empty Row",
action: function(e, dt, node, config) {
editor.create(false).submit();
}
}]);
table
.buttons().container().appendTo($('#createempty'));
How might I go about extending this so that I can create 5 blank rows with one button click? Can I create multiple actions with the above code?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I haven't tried it but it looks like there is a parameter
count
forcreate()
that should work. Take a look at the second to the last example.https://editor.datatables.net/reference/api/create()
Kevin
Brilliant, thanks Kevin (a case of RTFM!) Here's the code if it's useful for anybody