How do you disable the "Delete" button on a list or library control? I want users to be able to edit items, but not delete them.
Also, is it possible to disable multiple selections? So that the user can only select one item at a time.
How do you disable the "Delete" button on a list or library control? I want users to be able to edit items, but not delete them.
Also, is it possible to disable multiple selections? So that the user can only select one item at a time.
Dear @tnewton,
You can use the following code to hide the delete button altogher and disable selection of more than one:
fd.spRendered(function() {
fd.control('SPDataTable1').ready().then(function(dt) {
//hide Delete on load
dt.buttons[1].visible = false;
dt.$watch('selectedItems', function(items) {
//hide Delete on select
dt.buttons[1].visible = false;
//disable selecting more than one row:
var grid = fd.control('SPDataTable1').widget;
grid.tbody.on("click", ".k-checkbox", onClick);
function onClick(e) {
var row = $(e.target).closest("tr");
if(row.hasClass("k-state-selected")){
setTimeout(function(e) {
var grid = $("#grid").data("kendoGrid");
grid.clearSelection();
})
} else {
grid.clearSelection();
};
};
});
});
});
Thank you! That worked beautifully.