EXAMPLE: Transferring State VIEW SOURCE

This example demonstrates how the UIZE JavaScript Framework's state oriented design facilitates easy transfer of state from one widget instance to another. Transfer is as simple as getting a bucket of state from one widget instance using the get method, and then setting that bucket of state on the other widget instance using the set method.

In the example, two instances of Uize.Widget.Resizer.Marquee are wired up on the page. A button below each instance allows you to transfer its left, top, width, and height state to the other instance. The tooltip for each button indicates the code being executed by click. Mess around with a marquee, change its position and dimension, and then transfer its state to the other. It's fun for the whole family!

Marquee 1
TRANSFER MARQUEE 1 STATE TO MARQUEE 2  >>
Marquee 2
<<  TRANSFER MARQUEE 2 STATE TO MARQUEE 1