I have created a custom button to work in place of the "New" button on list control. To be consistent with the other list controls I have I would like to place my custom button in place of the default button. I have hidden the default new button. Is there a way to change the location of my custom button? I see a location when I log in console for fd.control('MyControl').buttons. But I am not able to change modify.
Dear @cwalter2,
The position of the button depends on its index in array. Try the following code to add new button as the first item of the array:
var buttons = fd.control('MyControl').buttons;
const newButton = {text: "Export",
class: 'btn-secondary',
visible: true,
icon: 'PDF',
iconType: 0,
click: function() { alert("Exporting!"); }}
fd.control('MyControl').buttons = [newButton].concat(buttons)
Awesome that worked perfectly!