Disable "New Folder" Button on List or Library Control

How do you disable the "new folder" button on a list or library control? I want users to be able to upload files, but not create a new folder.

image

Hello @tnewton,

Looks like you are using an outdated version of the app package, as the toolbar buttons of the List or Library control in SharePoint Online have changed, and there is no separate 'New folder' button anymore.

Please check the app package version. You can fin it in the console (F12) >> Source. The latest version is 1.0.8. Please follow the instructions on how to Update the app package to get the latest version.
image

Also please check the desktop designer version, it can be found in the bottom right of the program.
image

Thank you! That worked.
Now, how to you hide the New button?
$(fd.control("spdtProposal").$el).find('.btn').hide();
I tried the code above, but it hides all the buttons. I want the Upload button, not New.
image

Hello @tnewton,

Great! To hide the new utton just add this code:

fd.spRendered(function() {
    fd.control('SPDataTable1').ready().then(function(dt) {
        dt.buttons.forEach(function(button){
            if(button.icon == "Add") {
                button.visible = false
            }
        });
    });
});

Replace SPDataTable1 with the internal name of the control.

Perfection! Thank you.

1 Like