How to hide add/remove all from the multirow variable set
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 01:38 AM
Hi Team,
Can someone please help me on the below issue.
How can we remove the add / remove all and actions from the table it is multirow variable set.
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 01:44 AM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 05:23 AM
I have tried the above code still i am not able to remove the Actions please refer the below image.
Script:
function onLoad() {
//MRVS is loaded after the form is loaded. Hence setting a delay of 2 secs.
setTimeout(function() {
disableButtons();
}, 2000);
}
function disableButtons() {
var mrvsid = '50bc13ad1b69f5107222ebd6ec4bcbae';//sys_id of MRVS
if(window == null){//Service Portal
//hide Add button on MRVS
this.document.getElementById(mrvsid + '_add_row').style.display = 'none';
//hide Remove All button on MRVS
var mrvs = g_form.getField("snapshot_change");//internal name of MRVS
mrvs.max_rows_size = 0;
var btn = this.document.getElementsByClassName("btn btn-default");
for (i = 0; i < btn.length; i++) {
if(btn[i].innerText == 'Remove All') {
btn[i].style.display='None';
//If you want to disable the button, but still show it, then use below line instead.
//btn[i].disabled="disabled";
}
}
var y = this.document.getElementsByClassName("btn btn-sm icon-cross multi-row-delete-row");
// alert(y.length);
var j;
for (j = 0; j < y.length; j++) {
y[j].style.display = 'none';
}
var icon = this.document.getElementsByClassName("wrapper-xs fa fa-close");
//alert(icon.length);
for (var j = 0; j < icon.length; j++) {
//alert(icon[j]);
if (icon[j].getAttribute("data-original-title") == 'Remove Row') {
//alert(icon[j].style.display);
icon[j].disabled = "disabled";
icon[j].style.display = 'None';
}
}
}
else{//native UI method
//hide Add and Remove All buttons on MRVS
document.getElementById('table_variable_buttons_' + mrvsid).style.display = 'none';
//hide only the Add button
document.getElementById(mrvsid + 'Add').style.display = 'none';
//hide only the Remove All button
document.getElementById(mrvsid + 'removeAllRows').style.display = 'none';
//hide delete and/or edit icon/button on each row of MRVS
var mrvs = g_form.getValue('snapshot_change');
var obj = JSON.parse(mrvs);
for (var i = 0; i < obj.length; i++) {
//delete - check Name, may be 'cross' instead
document.getElementsByClassName('btn-sm multi-row-delete-row')[i].style.display = 'none';
//edit
document.getElementsByClassName('btn icon-edit btn-sm')[i].style.display = 'none';
}
}
}
Please help me on the below code.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 05:31 AM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 01:51 AM