› Forums › General discussion › Expand Collapse
Tagged: Expand Collapse Custom Buttons
- This topic has 3 replies, 2 voices, and was last updated 2 years, 8 months ago by
Alexander Bautz.
-
AuthorPosts
-
-
June 30, 2020 at 15:17 #30811
Tricia S.
ParticipantI have some input buttons in my heading that has Expand/Collapse. And I’ve noticed some odd behavior.
When any of the buttons are clicked it triggers the Expand/Collapse before doing its onclick function.
Here is the save button in code:
<div class='tooltip buttonRight'><span class= 'tooltiptext '>Click to save and close the form. </span><input type='button' value='Save' id='SaveBtn1' onclick='spjs.dffs.triggerSave();return false;'></input></div>
Is there is anything I can do? It just looks odd.
While on this subject, It would also be interesting if in addition to remembering what tab the user was on if it could remember what headers were the
opposite of the the default as set by the user. or if you could set the default and then choose if it could remember the users settings or choose to ignore the users settings.Attachments:
-
June 30, 2020 at 15:54 #30816
Alexander Bautz
KeymasterTo stop the click from “bubbling” up to the parent item you must change your onclick function from “spjs.dffs.triggerSave()” to “customSaveBtn(event)” and add this to your custom js:
function customSaveBtn(e) { if (typeof e.stopPropagation != "undefined") { e.stopPropagation(); } else if (typeof e.cancelBubble != "undefined") { e.cancelBubble = true; } spjs.dffs.triggerSave(); }
Not sure I understand you next question – did you want to remember which headings were open when you revisit the same form at a later time? – if so, I’m sorry, but I don’t think I can do that.
Alexander
-
July 1, 2020 at 19:58 #30821
Tricia S.
ParticipantThanks!
No I think every time would be a bit much. I was more thinking just when you save but stay in edit form. since your are basically just saving any updates but keeping the form open.
Thanks again!
Tricia -
July 5, 2020 at 11:09 #30845
Alexander Bautz
KeymasterI’m not able to do this now, but I’ll see what I can do in a future version.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.