Thinfinity.JsRO
Description
A JavaScript pseudo-class for GUI remoting and full web integration. JsRO allows you to create remotable objects where properties, methods, and events are mirrored to native JavaScript objects.
Features
- Bidirectional synchronization between HOST and REMOTE
- Properties, methods, and events mirrored to native JavaScript objects
- Support for multiple REMOTEs communicating with a single HOST
- Automatic or manual linkage protocol initialization
Syntax
var JsRO = new Thinfinity.JsRO({
autoStart: true // optional, defaults to true
});
Parameters
| Parameter |
Type |
Default |
Description |
autoStart |
Boolean |
true |
Controls automatic initialization of the linkage protocol with the HOST |
Methods
| Method |
Description |
| start() |
Manually starts the linkage protocol with the HOST |
| on() |
Adds an event handler to a specific node |
| off() |
Removes an event handler from a specific node |
Properties
| Property |
Description |
| model |
Entry point of the data object tree |
Members
Requirements
A HOST must be previously created for the JsRO to communicate with.
Example
// Create JsRO with automatic start
var JsRO = new Thinfinity.JsRO();
// Or create with manual start
var JsRO = new Thinfinity.JsRO({
autoStart: false
});
// Start manually when ready
JsRO.start();
// Add event handler
JsRO.on('model:Form1.button1', 'click', function(elem) {
console.log('Button clicked');
});
// Access model data
var formData = JsRO.model.Form1;
See Also