Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate inline js handler for WaterCalendar.jsp #552

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
pointer-events: none;
}
</style>
<script type ="text/javascript">
<script type="text/javascript" nonce="<%=getScriptNonce()%>">
function clearSelectedEvent() {
selectedEvent = {};
for (let key in WebUtils.VM.taskDetails) {
Expand Down Expand Up @@ -493,7 +493,7 @@



<script>
<script type="text/javascript" nonce="<%=getScriptNonce()%>">

//TODO: change var to let for all the following variables for better scoop management
var selectedEvent = {};
Expand Down Expand Up @@ -1208,11 +1208,13 @@
let volume = Ext4.util.Format.htmlEncode(errorObject.volume);
let date = Ext4.util.Format.htmlEncode(errorObject.date);
returnMessage += "<div id='waterException" + i +"'>There is another waterAmount on "+date+" for the volume of "+volume+" " +
" <button onclick=\"updateWaterAmount('"+clientObjectId+"')\">Update</button> " +
"<button onclick=\"deleteWaterAmount(null, null,'"+clientObjectId+"','waterException" + i +"')\">Delete</button><br></div>";

" <button class='water-updt-btn' data-clientObjectId='" + clientObjectId + "'>Update</button> " +
"<button class='water-dlt-btn' data-clientObjectId='" + clientObjectId + "' data-index='" + i +"'>Delete</button><br></div>";
}

LABKEY.Utils.attachEventHandlerForQuerySelector('BUTTON.water-updt-btn','click',function(){return updateWaterAmount(this.attributes.getNamedItem('data-clientObjectId').value);});
LABKEY.Utils.attachEventHandlerForQuerySelector('BUTTON.water-dlt-btn','click',function(){return deleteWaterAmount(null, null, this.attributes.getNamedItem('data-clientObjectId').value, "waterException" + this.attributes.getNamedItem('data-index').value)});

}
document.getElementById("modelServerResponse").innerHTML = "<p>"+returnMessage+"</p>";
document.getElementById("proceedButton").classList.remove("hidden");
Expand Down