Covert Action button to Text when Pushed
In this example, we will use the equation value as the display for the action link, so we will set up a condition using IF to show the button text or the message you’d like to show instead of the action link. Suppose the action link has already been clicked. You can set up your equation to show another field’s value or static values.
Step 1
Set up your equation; you may use this as a reference.
IF({Is Complete?}='Yes', CONCAT('The', CHAR(32), 'task', CHAR(32), 'has', CHAR(32), 'been', CHAR(32), 'completed!'), CONCAT('Set', CHAR(32), 'to', CHAR(32), 'complete'))
Step 2
In your table component, set up the action link. Set the equation as the display value of the action link and set your CSS class to "act-link."
Step 3
Add the following code to the JavaScript tab of your page.
TB.render('component_id', function(data) {
var links = document.getElementsByClassName('act-link'),i = 1, temp, text, removeThis;
var numLinks = links.length;
while(i<numLinks){
removeThis = links[i].getElementsByTagName("a")[0];
removeThis.setAttribute("onClick", "window.location.reload();");
text = removeThis.innerHTML;
if(!text.contains("Set to complete")){
removeThis.remove();
temp = document.createElement('span');
temp.innerHTML = text;
links[i].appendChild(temp);
}
i++;
}
});
Ensure you update the “component_id” to your table’s component ID.
For reference, you may find the component ID in the page builder by hovering over the info icon.
Original Community Post:
Add an Option to the display rule - Community Discussions / How Do I - Tadabase Community
We'd love to hear your feedback.