Need to override the keyup function with a home grown function

I have a jqGrid validation methodology that's killing performance, due to the fact that the validateDuplicates function is being injected into the keyup event. I want to use my own function which would only return true if a duplicate is found, and at that point a performance hickup is okay.

Can someone tel me how to make up my own function, and make it chainable?

Right now I have this:
$('[id^="Container_"]).keyup(validateDuplicates).change(validateDuplicates);

I need (at least I think I need) to write an alternative to keyup, call it displiatesFound. And in there I'd add each barcode to a list, after checking if it already existed. If it did exist, two duplicates are found.

Thanks!
newbiewebSr. Software EngineerAsked:
Who is Participating?
 
Gurvinder Pal SinghConnect With a Mentor Commented:
$('[id^="Container_"]).unbind("keyup");
0
 
Gurvinder Pal SinghCommented:
why don't you simply unbind the keyup event and see what happens?
0
 
newbiewebSr. Software EngineerAuthor Commented:
Not sure what you mean by unbinding...
0
 
newbiewebSr. Software EngineerAuthor Commented:
But then what action (or event) would call the jquery default error code?

Here's what I was going to do. Please tell me if this will work. Oddly, it seems to and I have not yet even created my own duplicates test. I planned to insert it inside the anonymous function I created.

$('[id^="Container_"]).keyup(function () {
     validateDuplicates()
}).change(validateDuplicates);

What do you think?
0
 
newbiewebSr. Software EngineerAuthor Commented:
I think my code unbinded it in a different way. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.