The Gallery is deprecated. No new Gallery components may be submitted, and modifying existing components is disabled. For more information please read the Gallery Deprecation blog post. This is a static snapshot of the Gallery for archive purposes.
See 50 more by this user. Created: 06/10/10
Project: YUI 3
License: YUI BSD
YUI Version: 3.5.1
Free for use.
A MultiObject exposes the same API as each individual object (both functions and events), and the state of all the objects is kept in sync. The objects must maintain all state via Y.Attribute. One example use-case is for multiple Paginator widgets in different locations, e.g., one on top and one at the bottom of a table.
Create several paginators and manage them all via MultiObject.
YUI().use('gallery-multiobject', 'gallery-paginator', function(Y)
{
function update(
/* object */ state)
{
this.setPage(state.page, true);
this.setRowsPerPage(state.rowsPerPage, true);
}
var p1 = new Y.Paginator(...);
var p2 = new Y.Paginator(...);
var p3 = new Y.Paginator(...);
var p = new Y.MultiObject([p1, p2, p3]);
p.on('changeRequest', update, p);
});
All code on this site is licensed under the BSD License unless stated otherwise.