Hi. I am hiding the Add Button in list control but when the form loads the New Button appears momentarily and then disappears as it should. I tried spBeforeRender but still the same happens so that is hidden before the form is rendered but does not work.
My code is below
fd.spBeforeRender(function() {
fd.control('SPDataTable1').ready().then(function(dt) {
dt.buttons.forEach(function(button){
if(button.icon == "Add") {
button.visible = false
}
});
});
});