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 6834083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:04:03+00:00 2026-05-26T23:04:03+00:00

I created two custom JQuery UI widgets with same name but with different namespaces

  • 0

I created two custom JQuery UI widgets with same name but with different namespaces as given below:
First widget:

$.widget('finance.dialog',{....}); // this was created in the file jquery.finance.dialog.js

Second widget:

$.widget('hr.dialog',{.....}); // this was created in the file jquery.hr.dialog.js

Apart from these two, JQuery UI has its own dialog widget (ui.dialog) in the namespace ui.

My question is:
Which dialog widget will be called when i call the following in a web page as given below?

$('div#something').dialog(); 

Please note I include all the three widget variants in the web page.

I understand there are conflicts in the above scenario. How can we invoke a widget function with its namespace so that there will not be any conflicts?

  • 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-26T23:04:04+00:00Added an answer on May 26, 2026 at 11:04 pm

    I had the same question, but I don’t think it’s possible to invoke a jquery ui widget with the namespace.

    If I understand correctly from this: http://bugs.jqueryui.com/ticket/7489
    By defining widgets with the same name, it’s by design to overwrite earlier definitions. Because regardless of namespace, the widgets are mapped with their name to $.fn.

    As suggested in the bug ticket you can use the bridge function to create a unique mapping to the specific namespaced widget and call it using the unique name.

    In your case, it can be like this:

    $.widget.bridge( "finance_dialog", $.finance.dialog );
    $.widget.bridge( "hr_dialog", $.hr.dialog );
    
    // then call it with...
    $( "div#something" ).hr_dialog(); 
    

    I suppose another way would be to create unique widget names in the first place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a custom control which consists of two radio buttons with their appearance
I created two very simple Heroku apps to test out the service, but it's
I'm a jQuery newb and I've been trying to create a custom slideshow widget
I have my main program with MainAppDelegate.h,MainAppDelegate.m . I have created two custom navigation
I've created custom, two level x-axis entries that tend to work pretty well. The
I created a custom View, with two Bitmaps. When I use the Bitmap outside
I am trying to create a custom jquery function which has two parameters, the
I created two custom ComboBox controls, both inherit from the default ComboBox control: public
I have created a custom scrollable tabbar [scrollview with buttons over it] below navigationcontroller.
I created a custom control which is actually just two labels inside a panel.

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.