This project has moved. For the latest updates, please go here.

Form keeps scrolling up and down when opening and collapsing the accordion

Feb 13 at 1:07 PM
First off, great job on this project and my team likes the look and feel of the forms.

Two questions I have,
1) Is there away to keep the form from scrolling up and down when expanding the accordions?

Additional Details #1:
Each time the accordion is expanded the form seems to jump back to the top. Also when the accordion is collapsed, we seem to have extra White space at the bottom of the form that was not there before expanding. Any ideas on these two issues?

2) Is there a function where we can tell EasyForms how and when to show the Title and/or field Descriptions?

Additional Details for #2:
Currently we are hiding the first column in SharePoint and moving the Titles above the input fields in the second column. All this is being done with JQuery before SPEasyForm makes any updates or changes.
We have the following cases we are trying to cover:
  1. Show just the Title field and move it above the input field.
  2. Show just the Description and move it above the input field.
  3. Show both the Title and Descriptions and move them above the input field separated with an empty line.
  4. Show the Title above the input field and the Description below the input field.
Coordinator
Feb 15 at 2:40 PM
Edited Feb 15 at 3:09 PM
RE 1: As a general rule, SPEasyForms is going to work better if forms are not launched in a dialog. Since configuring the form with SPEasyForms does change the size of the form in a way that SharePoint doesn't understand, and it occurs after SharePoint has sized the dialog, I have to resize the dialog after SPEasyForms does it's work. I'm using the same SharePoint JavaScript function that OOB forms are using to resize it, and for whatever reason that function makes the form a bit bigger than it has to be, thus the extra white space at the bottom. But SharePoint dialogs are pretty complex, and they're different in each version of SharePoint (i.e. 2010, 2013, Online, etc.), so it would be crazy for me to try to resize the dialog myself instead of using the OOB JavaScript function. In other words, Microsoft is putting in the extra space at the bottom and only Microsoft can remove it, but somehow I doubt that they will.

Also, I'm not doing anything to scroll the form when you open an accordion. That's just a side effect of the way jQuery-UI interacts with SharePoint. Again, it's less of an issue when the form isn't in a dialog, but still a little bit of an issue, and I don't think I can fix it. jQuery UI isn't doing the scrolling either, it's the browser itself that does it based on the way SharePoint dialogs are rendered.

For these reasons, I usually turn off launch forms in dialog on any form where I'm using SPEasyForms. I can understand why someone might not want to do that, but I think the quirks of SPEasyForms in SharePoint dialogs are not really fixable; it works about as well as it's ever going to (and it was a real PITA getting it to work at all ;).

RE 2: SPEasyForms doesn't have any functionality that you can use to do these things. I do move the title so it is over top of the input on a columns container if there is more than one column, but that's automatic. It doesn't expose any functionality for you to do this at will. And SPEasyForms doesn't do anything with the description.

Joe
Marked as answer by mcsheaj on 2/16/2017 at 7:07 AM