Hello!
I have been working with retool for a while now.
Right now I want to make a cell editable in the role column only if it is selected.
I tried the following code:
{{ rt_expertAttendance_table.selectedRows.some(row => row.id === currentSourceRow.id) }}
in the editable field of the column, but it lets me edit even without selecting the row.
here are the table infos that I have:
role column:
table:
Addtionally, said role is from my database which has the enum datatype and I want to have specific colors accordingly. I used this code under the colors field in the option list, but this unfortunately doesnt work as well:
{{
(() => {
const roles = Array.isArray(show_roles_attendance_ac.value)
? show_roles_attendance_ac.value
: [];
const baseColors = ["#b7db7a", "#7fbf3f", "#4f8f2f", "#2f5f1f"];
return roles.reduce((acc, role, i) => {
acc[role] = baseColors[i % baseColors.length];
return acc;
}, {});
})()
}}

