Set required field causes slow performance

Forums Classic DFFS Set required field causes slow performance

Viewing 6 reply threads
  • Author
    Posts
    • #9720
      jstadick
      Participant

      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

    • #9722
      jstadick
      Participant

      More info..

      The field I’m requiring is a lookup field with over 1000 options.

    • #9727
      Alexander Bautz
      Keymaster

      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

    • #9729
      jstadick
      Participant

      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 80020101

      Chrome gives : SyntaxError: Unexpected token ILLEGAL

      Not sure what I’m doing wrong here.

    • #9731
      jstadick
      Participant

      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

    • #9733
      Alexander Bautz
      Keymaster

      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

    • #9737
      jstadick
      Participant

      Ahhh….I’ll keep that in mind next time!

      Hope you have a good new year.

      John

Viewing 6 reply threads
  • You must be logged in to reply to this topic.