Solved

Unobtrusive behavior for field validation is too slow

Posted on 2011-09-26
5
334 Views
Last Modified: 2012-05-12
We use a jqGrid to contain multiple pairs of input fields and we currently use Unobtrusive JavaScript behavior to validate the fields. The problme is that there are far far too many calls, since this type of validation confirms every field against every other field already entered, as it looks for duplicates. Thie create over 30,000 calls for 10 records! We neeed to support over 50 records, so this is a hufge problem.

What I would like to do is validate the current field only. When the user mouses away or even mouse clicks that field, I'd like to NOT re-run the validation that's already been validated.

Any idea how to do this with jQuery and jqGrid?

Thanks.
0
Comment
Question by:newbieweb
  • 3
  • 2
5 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 36704867
What is the validation you need per field and what do you NOT want to run again?
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 36708426
When you say "Unobtrusive JavaScript behavior" - do you use a specific library or do you just mean

window.onload=function() {
...
}

or

$(document).read(function() {
...
});

and is this a duplicate of I need to speed up validation done by jqGrid
0
 

Author Comment

by:newbieweb
ID: 36708957
I deleted the other one. They were a little different but mostly the same.

The jqGrid is configured with AJAX to handle all validation on creation of the jqGrid. But the amount of validation going on is crazy. It's because we require the fields to be unique and it runs its uniqueness test each time it runs, and this creates an exponential number of calls needing to be made. I started writing my own validation, but would be happy to use jqGrid's if it had an option to run like the one I will write.

When the user enters a new value, I will check it for duplicates against all other values already entered. When I display the new duplicates in Red, I will NOT clear out prior duplicates (also shown in red). If I cleared it out, that would mean I needed to recheck the entire list each time, which creates exponential growth in the number of comparison checks, which kills performance.

So I wonder if jqGrid has this option.

Thanks.
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 36709387
That is a VERY specific question

Did you try asking it here: http://www.trirand.com/blog/?page_id=393
0
 

Author Closing Comment

by:newbieweb
ID: 36719385
Thanks for the link.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now