I set up a tasklist with checkboxes that I would like to re-use.
It is inconvenient to have to uncheck each one - one at a time - when I want to reuse my page. Is there a way I can make a button to reset all checkboxes?
Sorry to necro this question but I have been looking for a solution to this for a while and have given up and writen a user macro to provide this functionality.
The code is available here
Hi Lee! How can I get your javascript user macro enabled in my Confluence wiki page?
I appreciate your help.
Thank you a lot!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to be a confluence admin.
Then you can define new user macros at Admin > Configuration > User Macros.
That is where you can paste the code provided.
Once that's saved, as a user:
You add the user macro on the page. It renders a button you can click on.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is what worked best for me and my needs based on @Lee Cannon 's code found here :
{HTML Macro Start}
<button>onclick="untick()">Clear List</button>
<div id="taskList">
{HTML Macro End}
[ ] Task-1
[ ] Task-2
[ ] Task-3
{HTML Macro Start}
</div>
<script type="text/javascript">
function untick() {
var list = document.getElementById('taskList');
var base_url = window.location.protocol + "//" + window.location.host
var token = document.getElementById("atlassian-token").getAttribute("content")
var tasklist_id = list.getElementsByClassName("inline-task-list")[0].dataset.inlineTasksContentId;
var boxes = list.getElementsByClassName("checked");
var number_of_boxes = boxes.length;
var completed_boxes = 0;
for (i = number_of_boxes-1; i >= 0; i--) {
var task_id = boxes[i].dataset.inlineTaskId;
var xhttp = new XMLHttpRequest();
var url = base_url + "/rest/inlinetasks/1/task/" + tasklist_id + "/" + task_id + "/" xhttp.open("POST", url, true);
xhttp.setRequestHeader("Content-type", "application/json");
xhttp.send('{"trigger": "VIEW_PAGE", "status": "UNCHECKED"}');
boxes[i].className = "";
}
}
</script>
{HTML Macro End}
- I ignored the request's response because I don't really care if it fails in my case (it never did.)
- I added a <div id="x"></div> around the tasks to limit my search range and avoid modifying other tasks.
- I removed the location.reload() to avoid reload blink and replaced it with a className = "" to remove the "checked" class.
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robert,
I'm afraid this is currently not possible, but I've created a feature request for this at https://jira.atlassian.com/browse/CONF-37184. Please feel free to watch it to track its progress, as well as commenting and voting for it.
Regards,
Gustavo Refosco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please visit https://community.atlassian.com/t5/Trello-questions/Checklist-check-uncheck-all/qaq-p/597706#U1021297 to see if my proposed solution would work for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.