In general this is handled by having the widget be on a container element. A
couple examples are selectable and sortable. We don't call .sortable() or
.selectable() an elements that should be sorted and selected, but on
containers of elements that can be sorted and selected. Does that help?
- Rich
So in other words, there is no way to know how many are in the
collection without figuring that out, outside of the plugin. Right?
So something like:
var numElems = $(".bob").length();
$(".bob").plugin(); // then reference numElems in the plugin
But then there is no way to know which number of
See http://wiki.jqueryui.com/Widget-factory
"If you select multiple elements and call .myWidget() on the collection, a
separate plugin instance will be instantiated for each element. In other
words, this.element will always contain exactly one element."
- Richard
On Thu, Jun 4, 2009 at 12:35 PM