nI3o
December 17, 2019, 1:23pm
1
Hey,
is it possible to completly hide the standard list buttons? As soon as i try to manipulate one of the standard buttons i get an error. It only works for my own buttons.
fd.control('SPDataTable2').buttons[0].class = 'btn-danger'; //my button
fd.control('SPDataTable2').buttons[1].class = 'btn-danger'; //standard button => TypeError: "fd.control(...).buttons[1] is undefined"
This should be the right code?
fd.control('SPDataTable0').buttons[2].visible = false;
Best wishes
Nico
p.s. is there an overview for all the BB-Codes?
Hello @nI3o ,
If you need to display only your custom button, you can remove all default List or Library buttons first, and then add your custom button.
Please see the code sample below.
fd.spRendered(function() {
var customButton = {
text: 'DisplayedText',
class: 'btn-secondary',
visible: true,
click: function() {
console.log('button is clicked');
}
}
fd.control('SPDataTable0').ready().then(function(dt) {
//dt parameter is the same as fd.control('SPDataTable0')
//remove all default buttons
dt.buttons.length = 0;
//add a custom button
dt.buttons.push(customButton);
});
});