Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

{HELP] Button to delete all Row of a repeating Section and Reset values of some attributes

1533291523
Mike W.
Pro
Sheet Author
I am a TOTAL novice when it comes the HTML and CSS coding. I need to have a button on a character sheet that does the following: 1. When clicked it says "Are you ure you wan tto set this table back to default values?"  2. Once confirmed, it deletes all the rows from a specific Repeating Section (fieldset) 3. abd it resets the values of some attributes Basically I am trying to create a "Reset to Default" button Any help here, along with some examples, would be greatly appreciated. Mike
1533293647
Andreas J.
Forum Champion
Sheet Author
Translator
I'm 95% sure you'll need sheet workers to perform the deletion of the repeating section, triggering to the button push. Still a novice with sheet workers so exactly how this would be made, other than it would like use this sheet worker function .
1533435835
Mike W.
Pro
Sheet Author
OK I will start there but so far i have found nothing on how to do this yet.
1533460628

Edited 1533460752
Finderski
Pro
Sheet Author
Compendium Curator
You may want to check out the Boostrap thread in this forum, because I believe a button action was created for the Charactermancer; that being said, I don't know if it works outside of the Charactermancer portion of a character sheet.   The traditional way would require a, probably, a couple of checkboxes that are formatted with CSS to look like buttons, but aren't; getting the pop-up isn't possible, though.  The first checkbox would be a button that you could label whatever makes sense, but something like Reset. The other two checkboxes are hidden.  When the Reset "Button" is clicked, the CSS hides that button, and reveals a previously hidden section that has two check boxes, one for Yes and one for No.  If the Yes button is clicked, it Sheetworker watches for that change and does what you want by deleting the rows, etc.  If the No button is selected, you want a sheet worker to watch for that, so it could unselect all the checkboxes to show the reset button and hide the others again.   Of course, the Yes/No buttons should be in a container with verbiage that asks if they are sure they want to delete/reset the section. There are probably other/better ways of doing this, but this is how I'd handle it, given my rudimentary knowledge of anything beyond simple HTML/CSS. EDIT: The bootstrap thread doesn't contain this information...It's here somewhere, but I can't remember where I saw it...
Scroll down to the Technical Specifications section in Steve's Dev Update here: <a href="https://app.roll20.net/forum/post/6455996/dev-update-6-slash-5-slash-2018-the-charactermancer/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/6455996/dev-update-6-slash-5-slash-2018-the-charactermancer/?pagenum=1</a>
1533524026
Mike W.
Pro
Sheet Author
I think I have the button itself figured out, What I do not know is how to reset the values for the attribute back to default values and deleting all the rows from the specific repeating section.
1533557951
Finderski
Pro
Sheet Author
Compendium Curator
Mike W. said: What I do not know is how to reset the values for the attribute back to default values and deleting all the rows from the specific repeating section. You need to reset the values, you'd use the setAttrs() function and to delete the rows, you'd you use the removeRepeatingRow() function. &nbsp;Both are documented on the wiki for Sheetworkers:&nbsp; <a href="https://wiki.roll20.net/Sheet_Worker_Scripts#removeRepeatingRow.28_RowID_.29" rel="nofollow">https://wiki.roll20.net/Sheet_Worker_Scripts#removeRepeatingRow.28_RowID_.29</a> To remove the rows, you'll need the Row ID(s). &nbsp;If you need to remove all the rows, you'll likely need to use the getSectionIDs() function.
1533595766
Mike W.
Pro
Sheet Author
Finderski said: Mike W. said: What I do not know is how to reset the values for the attribute back to default values and deleting all the rows from the specific repeating section. You need to reset the values, you'd use the setAttrs() function and to delete the rows, you'd you use the removeRepeatingRow() function. &nbsp;Both are documented on the wiki for Sheetworkers:&nbsp; <a href="https://wiki.roll20.net/Sheet_Worker_Scripts#removeRepeatingRow.28_RowID_.29" rel="nofollow">https://wiki.roll20.net/Sheet_Worker_Scripts#removeRepeatingRow.28_RowID_.29</a> To remove the rows, you'll need the Row ID(s). &nbsp;If you need to remove all the rows, you'll likely need to use the getSectionIDs() function. OK looks like I have my work out out for me. Thanks for the information Finderski - for now this is above me but I think I will be able to figure it all out. Mike