to call the widget: $('<div></div>').attr({id:'the_widget'}).mywidget(fff:function(){});
Dirceu 2008/12/1 DiTieM <[EMAIL PROTECTED]> > > Maybe what I am pretending to do is something that JQuery wants to > avoid, but I am very frustrated with the following idea. Let's image > we have a simple "class": > > $.widget( "ui.mywidget", > { > ... > f: function ( ) { .... fff( ) ; ... } > .... > // to be overriden > fff: function( ) { } > } ) ; > > and now I create a div element that "extends"[1] "mywidget": > > div = $(document.createElement( "div" )).mywidget( ) ; > > what I want to do is to "define the fff" function in a way, that when > it is called from f (div.mywidget( "f" ) or div.mywidget( "fff" ) ) it > will be invoked. > > I expected something like: > > $.extend( div, ui.list_box, { fff : my_new_func } ) ; > > to work, but it does not. > > Any help is very appreciated, > Thanks in advance, > > David > > [1] sorry if the terms that I use are not very precise, but I am not > an expert in JS >