Home › Forums › Classic DFFS › Set required field causes slow performance
- This topic has 6 replies, 2 voices, and was last updated 8 years, 10 months ago by jstadick.
-
AuthorPosts
-
-
December 31, 2015 at 18:27 #9720
I’ve got a for with DFFS (DFFS Backend v4.356|CSS version: 4.10 / 4.10|spjs-utility version: 1.252)
On this form, if I set a field to required, I’ve tried a rule on load and one on a field change, the overall performance of the form becomes very sluggish. For example just changing tabs takes about 12 seconds to give focus to the first field of the selected tab.
Anyone seen anything like this?
Thanks,
John
-
December 31, 2015 at 18:32 #9722
More info..
The field I’m requiring is a lookup field with over 1000 options.
-
January 1, 2016 at 13:46 #9727
Hi,
I guess you use IE8 or IE9? – this browser is slow to perform some “selections” in JavaScript, and this causes the lagging when applying the required item star.I have looked at it, and think I have fixed it. I will include this in the next release, but until then you can add this to the “Custom JS” in the form where you have this problem.
spjs.dffs.do_starRequired = function(){ spjs.$("td.dffs-formvalidationWrap").remove(); spjs.$("span.dffs-formvalidation").remove(); spjs.$(".dffs-sbs-required").removeClass("dffs-sbs-required"); spjs.$(".dffs_required").removeClass("dffs_required"); spjs.$.each(spjs.dffs.data.requiredFields,function(i,fin){ if(spjs.$(spjs.dffs.fields[fin]).find('td.ms-formlabel').find('.ms-formvalidation, .ms-accentText').length===0){ if(spjs.$(spjs.dffs.fields[fin]).find('td.ms-formlabel').is(":hidden") && spjs.$(spjs.dffs.fields[fin]).find('td.ms-formbody').is(":visible")){ spjs.$(spjs.dffs.fields[fin]).find('td.ms-formbody').before("<td valign='top' class='dffs-formvalidationWrap' style='padding-top:5px;'><span class='dffs-formvalidation'>*</span></td>"); }else{ spjs.$(spjs.dffs.fields[fin]).find("td.ms-formlabel div.dffs_tdWrap").append("<span class='dffs-formvalidation'> *</span>"); } spjs.$(spjs.dffs.fields[fin]).addClass("dffs_required"); } }); }
Let me know how this performs.
Alexander
-
January 1, 2016 at 16:29 #9729
Alexander,
When I add this I get:
DFFS: There is an error in the Customer JS textarea:
Error: Could not complete the operation due to error 80020101Chrome gives : SyntaxError: Unexpected token ILLEGAL
Not sure what I’m doing wrong here.
-
January 1, 2016 at 19:09 #9731
In the end, I decided to put an AutoComplete field on the form (required that field) and used the autocomplete to set the value of the hidden lookup field.
Seems to be working fine with no performance issue.
Thanks for the help!
John
-
January 2, 2016 at 08:19 #9733
Hi,
I’m glad you found another solution. The error message indicates you might have to paste the code snippet in Notepad first – to format it as plain text.Alexander
-
January 2, 2016 at 14:23 #9737
Ahhh….I’ll keep that in mind next time!
Hope you have a good new year.
John
-
-
AuthorPosts
- You must be logged in to reply to this topic.