Home > Forum > Rules, JS, SQL > Feature requests: item list delete button visibility restriction

Feature requests: item list delete button visibility restriction
0

Hi,

we have a column visibility/edit/requirement restriction for every field in an item list. But there is no column visibility restriction for the delete button, so you cannot prevent deletion of some rows.

It is something you can do easily with js, but only with classic display form mode. It doesn’t work with modern forms. The problem is that it is not guaranteed that your form rules “Main form -> Behavior-> forms rule to be executed on page load” are being executed AFTER the page has been rendered.

I use the following js function for hiding the delete button, depending on a value in the row:

function hideDelete(listId, nachtragAttribute) {
if (SubelementHasRows(listId) > 0) {
for (i = 1; i <= SubelementCountRows(listId); i++) {
var value = GetSubValue(listId, i, nachtragAttribute);
if (value === "1") {
let sel = "#SubElems_" + listId + " button.subelements-action-button__delete-row";
$(sel).eq(i - 1).hide()
}
}
}
}

We are currently migration all of our WebCon applications from classic form mode to modern display mode on BPS portal. We'd like to migrate a new SharePoint free WebCon system.
I needed this functionality very urgently, so I implemented it quick & very dirty with a js timeout :( , meaning that the js function will be call with a delay of 1s.

Additionally, or alternatively it would be nice to a have an html field type also for item list columns. In html with some js, I could easily add a delete button when necessary.

Thank you,
Balint

Nobody has replied in this thread yet.