How do I Disable Inline Edit using JavaScript?

Kathleen Janiszewski April 6, 2023

I want to keep the user from changing values in certain ConfiForm fields within a TableView macro after a certain date.  Basically, I want to make all the previous weeks' fields readonly.  I have JavaScript that figures out what "today" is and what week of the year it is.  I have my fields named for those weeks.  I have the code, what I'm trying to get are the HTML id's that will allow me to access those fields and make them ready only.  Alternatively, I need a way tick the "Disable Inline Edit" box in the Form Field macro in JavaScript in the AJS.toInit function.  Any ideas?

1 answer

1 accepted

0 votes
Answer accepted
Kathleen Janiszewski April 6, 2023

Ok.  My collague fiugred it out.  In my for loop in my AJS.toInit function, I needed:

let fieldname = "td.cfgrid.cf_week"+i.toString()+"hours";

document.querySelectorAll(fieldname)[0].style.pointerEvents = "none";


The above basically has the effect of checking the "Disable Inline Edit" box, but in JavaScript.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events