Class s7sdk.Observable
All classes interested in the notification must implement methods that are part of this interface.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
addPropertyListener(property, listener)
Function to call to subscribe for a particular property change notification.
|
|
addPropertyListeners(listener)
Convinience method, subscribe to listen to all observable properties.
|
|
notifyPropertyChanged(property, oldValue, newValue)
Internal method really, to be called on property change.
|
|
removePropertyListener(property, listener)
Remove property listener.
|
|
removePropertyListeners(listener)
Convinience method, remove listeners to all components' properties.
|
Class Detail
s7sdk.Observable()
- See:
- s7sdk.model.CSSPositionModel
- s7sdk.model.CSSSizeModel
- s7sdk.model.CSSTextModel
Method Detail
addPropertyListener(property, listener)
Function to call to subscribe for a particular property change notification. Note that
listener callback fusntion should take three arguments: property, oldvalue, newvalue.
You should also add the listner with "bind", so that "this" refers to caller instance. For example:
obesrvableinstance.addPropertyListeners(this.propertyChangeListener.bind(this));
- Parameters:
- {String} property
- Property to listen to, for example CSS properties: "width", "height", "top", "bottom", etc.
- {Funstion} listener
- A function to call when the property changes its value. It must take three arguments: property, oldvalue, newvalue.
addPropertyListeners(listener)
Convinience method, subscribe to listen to all observable properties.
- Parameters:
- listener
notifyPropertyChanged(property, oldValue, newValue)
Internal method really, to be called on property change.
- Parameters:
- property
- oldValue
- newValue
removePropertyListener(property, listener)
Remove property listener.
- Parameters:
- property
- listener
removePropertyListeners(listener)
Convinience method, remove listeners to all components' properties.
- Parameters:
- listener