Reference to buttons.name in config
Reference to buttons.name in config
in DataTables 2
Is it possibe to use the buttons.name setting to activate a set of buttons in a layout definition? (like 'buttons:main' or similar)
I would like to define multiple sets of buttons in the default settings and be able to refer to them in the config locally, but maybe this needs to be done through API calls after config?
KR, Bjørn H
This question has an accepted answers - jump to answer
Answers
Do you mean using something to indicate which buttons should be displayed in the
layout? If you want a different set of buttons depending on some external variable, you would need to include the logic for that in the initialisation.Allan
I meant to have something like
in $.fn.dataTable.defaults
and then be able to refer them like
or
or something similar..
/bjørn
isn't possible. It would be like
. Typically the second declaration will be the one that the Javascript engine will use.
let i = 1; i = 2;and expectingito be 1 and 2You would need to do something like:
Then:
Better would be to have a function that would accept an array of options:
which I think is more inline with what you are looking for. I'm afraid that isn't something that is available in Buttons at the moment, but I don't see any reason why such a thing couldn't be written.
Allan