Questions tagged [jquery-ui-widget-factory]

jQuery UI Widget Factory is a simple and reusable base on which all of jQuery UI's widgets and interactions are built.

jQuery UI Widget Factory is a simple and reusable base on which all of jQuery UI's widgets and interactions are built.

It provides a flexible base for building complex, stateful plugins with a consistent API. It is designed not only for plugins that are part of jQuery UI, but for general consumption by developers who want to create object-oriented components without reinventing common infrastructure.

It does not have any dependencies on the rest of jQuery UI, but most of jQuery UI is dependent on it.

74 questions
12
votes
1 answer

Proper way to create an instance variable using jQuery UI Widget Factory

I'm using the jQuery UI widget factory. $.widget("myPlugin" , { options: { }, _create: function() { }, instanceVar: "huzzah!" }); On testing, it looks as though instanceVar is actually part of the prototype. So it is the…
user1031947
  • 6,294
  • 16
  • 55
  • 88
9
votes
7 answers

requirejs + jqueryui = $.widget not defined

I am using requirejs + jquery + jqueryui. I have read TONS of examples of how to do this. I think I understand the various approaches and it seems to me that my setup should be working correctly. However, I occasionally get a $.widget is not defined…
Dustin
  • 2,091
  • 3
  • 15
  • 13
7
votes
1 answer

Live Binding Events in jQuery UI Widget Factory using this._on()

I am currently developing a cascading tree menu. When a tree item is expanded it creates new
's below it that may also be expanded. I can get the first set of
's to bind and thus expand, but I can't seem to get the newly created div's to…
Chris Tierney
  • 1,539
  • 1
  • 8
  • 16
5
votes
1 answer

How to store a internal property in jquery-ui widget?

I am programming a new jquery-ui widget from scratch. I found the official 'how widget factory works' document. (http://jqueryui.com/demos/widget/) The widget itself works fine. Now I want to store some values internally - is there a preferred way…
5
votes
1 answer

Difference between React.js and jQueryUI widget factory

I've been reading about react.js library from Facebook lately, but I cannot see any difference between React and jQueryUI widget factory. Can someone make comparison between the two and tell me why should I use react.js instead of jQuery widget…
Tjodalv
  • 340
  • 3
  • 15
4
votes
1 answer

Is it not possible to set an on() listener for a jqueryui/jqm widget event on $(document)?

I'm trying to set a global event binder on $(document) which roots to all of my core application functions. I'm using some jQueryUI widgets (from jQuery Mobile) and was hoping I could also include the widget events in my global handler. So I'm…
frequent
  • 27,643
  • 59
  • 181
  • 333
4
votes
1 answer

jQuery Widget Factory _trigger Instance

When using the _trigger method in order to fire events I've hit a snag which I keep hitting but fail to properly grasp. Basically, if there's more then one instance of my widget, the last widget to be instantiated on the same page takes precedence…
EasyCo
  • 2,036
  • 20
  • 39
3
votes
1 answer

jQuery UI widget factory: how to reference widget instance using 'this' inside a options?

I have the following code snippet: $.widget("tj.commonCoordinator", { options: { "obx_type": "common_obx", "obx_callbacks": { request_modify: function(event, ui) { this._loadentries(); }, …
Jinghui Niu
  • 990
  • 11
  • 28
3
votes
2 answers

Javascript: How to reference the owner of the owner object inside a options object like this?

I wrote a jQuery UI widget like this: $.widget("ns.wid", { options: { attr1: "something1", attr2: { "sub_attr": this.__renderList, "css": { "opacity": '0.58' }, }, …
Jinghui Niu
  • 990
  • 11
  • 28
2
votes
2 answers

jQuery UI Widget Factory get context of current widget

Is there a global reference to the widget itself once it's been created using the jQuery UI widget factory pattern? I've tried doing things like setting a widget var equal to the widget: $.widget("my.widget", { _widget: this, _create: function…
farina
  • 3,486
  • 6
  • 32
  • 44
2
votes
3 answers

How to use jquery-ui selectmenu extension methods(_renderItem, _renderMenu etc)

The JQuery-UI selectmenu widget has some extension methods that can be used to customize rendering/styling of the dropdown select menu. From the api docs , the following widget extension methods can be used to customize the menu: - _renderItem(…
2
votes
0 answers

Exclude widget's input fields from being submitted in parent form

I've created a widget using the widget factory and have added elements like that are required by it. This widget can be initialized inside a form element, resulting in submitting the added fields when the parent form is submitted. I want to…
Odys
  • 8,951
  • 10
  • 69
  • 111
2
votes
1 answer

How to use data on _trigger for custom widget?

I have a widget created using jquery ui widget factory. I'm trying to pass some data to my custom event like this this._trigger('myCustomEvent', ['Test', 'Test2']); but on my handler I'm not sure how to access custom parameters onMyCustomEvent:…
StackOverflower
  • 5,463
  • 13
  • 58
  • 89
2
votes
2 answers

To _destroy() or to destroy()?

I'm a little confused as to which _destroy or destroy method in a jQuery UI Widget to implement. In this MSDN Widget Reference it says to implement destroy(), but in this Tutorial Plus reference it says to implement _destroy(). Both references say…
Reactgular
  • 52,335
  • 19
  • 158
  • 208
2
votes
2 answers

Recommended way to remove events on destroy with jQuery UI Widget Factory

I'm using the jQuery UI Widget Factory to build a jQuery plugin. My plugin binds custom events to the window... _subscribe: function() { $(window).on("dragger.started", function() { ... }); } I am wondering how to go about removing these events,…
user1031947
  • 6,294
  • 16
  • 55
  • 88
1
2 3 4 5