Solved

Unobtrusive behavior for field validation is too slow

Posted on 2011-09-26
5
350 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn how to dynamically set the form action using jQuery.

739 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