Correct syntax when combining two button selectors
Correct syntax when combining two button selectors
I would like to dynamically add a button to a collection using button().add() and button-selector. Button selector {\d}-{\d} works:
table.button().add("0-7", {
text: 'Button',
action: function () {
}
});
But combining two button selectors {string}:name and {\d} fails:
table.button().add("mybuttonname:name-7", {
text: 'Button',
action: function () {
}
});
TypeError: Cannot read properties of undefined (reading 'buttons')
What is the correct syntax?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
According to the
button-selectordocs the{\d}and{\d}-{\d}expect integers. See the {\d} or {\d}-{\d} docs for details.I don't see an option in the docs to use a combo of name and index. I believe you can use
button().index()with themybuttonname:nameselector then use that as the first index of{\d}-{\d}.Kevin