Solved

Unobtrusive behavior for field validation is too slow

Posted on 2011-09-26
5
340 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

785 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