Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7619969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:49:26+00:00 2026-05-31T03:49:26+00:00

I am overriding the jquery ui method for close. In this way, I can

  • 0

I am overriding the jquery ui method for close. In this way, I can have it close based on a selected variable I establish.

var originalCloseMethod = $input.data("autocomplete").close();
$input.data("autocomplete").close = function(event) {
  if (!selected){
    originalCloseMethod.apply(this, arguments);
  }
  selected = false;
};

It works great except for when it needs to make a regular closer. For example, if I click outside of the autocomplete div. The API then calls for close and returns this :

originalCloseMethod is undefined

Which makes me realize that it’s calling this method internally inside the UI.

This is why I am assuming that the best way to write this code, is to extend the UI not just override it.

My question is, how would I apply this same method as an extension as opposed to an override?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:49:28+00:00Added an answer on May 31, 2026 at 3:49 am

    You call the close function and save it’s return value, not saving a reference to it:

    var originalCloseMethod = $input.data("autocomplete").close();
    

    Change it to:

    var originalCloseMethod = $input.data("autocomplete").close;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: jQuery attribute selector for multiple values I have this $('input:radio[name=foo]').change(function() { blah();
I'm having trouble overriding a ModelForm save method. This is the error I'm receiving:
I am overriding the clean() method on a Django form. I want to have
So I currently have a jQuery dialog with two buttons: Save and Close. I
I have a jQuery tab and I am currently overriding the .ui-widget-header . My
I'm using jQuery's .data() method to store some data using nested objects like this:
I have an image container based on Jquery Mobile listview element structure. Looks like
When overriding the MembershipProvider and calling it directly, is there a way to fill
when overriding the loadView method in UIViewController, should one call [super loadView] in the
I understand overriding a method/function redefines its implementation in the derived class from its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.