Disable Delete Button in List Control

Hi there,

I want to remove the "Delete" button from my list control. I have attempted to use the below link code but it doesnt seem to be working for me. In my JS code now I have successfully hidden the "New" button, but can't remove the delete. How can I do this? Appreciate the help

Hello @mhannaway,

You can use this code to hide the delete button in a List or Library control in dialog editing mode:

fd.spRendered(function() {
    fd.control('Control1').ready(function(dt) {
        fd.control('Control1').$watch('selectedItems',
            function(items) {
                fd.control('Control1').buttons[3].visible = false;
            });
    });
});

If the List or Library control is in inline editing mode, change the button index to 2:

fd.control('Control1').buttons[2].visible = false;