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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:31:38+00:00 2026-06-11T15:31:38+00:00

I am extending a jQuery UI widget using the $.widget factory. In this particular

  • 0

I am extending a jQuery UI widget using the $.widget factory. In this particular case I’m inheriting from Wijmo’s wijlinechart. I need to respond to the wijlinechart’s “painted” event from within my child class.

Consider this:

         $.widget("bw.wijlinechartcursor", $.wijmo.wijlinechart, {
             _create: function () {
                 var self = this;
                 $.wijmo.wijlinechart.prototype._create.apply(self, arguments);

                 self.element.on("painted", function (e) {
                     alert("Got painted in child via element.on"); // Doesn't get called.
                 });

                 // This works, but blows away the client code's handler (below)
                 self.options.painted = function (e) {
                    alert("Got painted in child class via options.painted!");
                 }                   

             },

             _painted: function () {
                 alert("Got painted in child via _painted");  // Doesn't get called.
             }
         });

         $("#mywijlinechartcursor").wijlinechartcursor({
             // ... stuff...
             painted: function (e) {
                 alert("Got painted in client code");
             }
         });

So what is the most effective way to handle an event down in a child class that is _trigger’ed by an inherited parent class?

  • 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-06-11T15:31:39+00:00Added an answer on June 11, 2026 at 3:31 pm

    Binding to the event with on() should work, then again that event is probably not named painted.

    Each widget has its own event prefix, which defaults to the widget’s name. If your base widget is not overriding this default value, the event will be named wijlinechartpainted.

    In any case, the prefix is available in the widget’s widgetEventPrefix property, so you can write:

    self.element.on(self.widgetEventPrefix + "painted", function(e) {
        alert("Got painted in child via element.on");  // Should be called.
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this jquery script for extending a child DIV 100%. It works fine,
I have a jquery widget like this: $.widget(ui.MyWidget, { options: { Value1: 10, Value1:
I just stumbled over a small problem when extending javascript objects using jQuery. When
I am using the resizable() function from jQuery to resize a div which contains
I'm using this wonderful jquery plugin found here... http://appgrinders.github.com/jquery-easy-drop-down/ Only problem is, it doesn't
When using JQuery, extending an object that has an overridden toString() function causes an
EDIT: looking for this: http://diminishing.org/extending-formtastic-with-a-sprinkle-of-jquery (If this works I'll answer my own question) I've
I'm currently extending the jQuery UI widget as follows: $.widget( custom.autocompleteCategorized, $.ui.autocomplete, { _renderMenu:
I'm using this jQuery script to animate a div to open/close when the user
I am extending the Visual Studio 2003 debugger using autoexp.dat and a DLL to

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.