Optional
attributes: anyOptional
options: anyOptional
commOptional
viewsStatic
serializersReplace model ids with models recursively.
Optional
manager: IWidgetManagerOptional
context: anyOptional
context: anyReturn an object containing all the attributes that have changed, or false if there are no changed attributes. Useful for determining what parts of a view need to be updated and/or what attributes need to be persisted to the server. Unset attributes will be set to undefined. You can also pass an attributes object to diff against the model, determining if there would be a change.
Optional
attributes: Partial<any>Optional
options: SilenceableConstructor
Initializes a WidgetModel instance. Called by the Backbone constructor.
widget_manager : WidgetManager instance model_id : string An ID unique to this model. comm : Comm instance (optional)
Test to see if the model has been synced with the server.
As of backbone 1.1, backbone ignores patch
if it thinks the
model has never been pushed.
Optional
eventName: null | stringOptional
callback: null | EventHandlerOptional
context: anyRest
...keys: A[]Optional
context: anyOptional
context: anyon_some_change(['key1', 'key2'], foo, context) differs from on('change:key1 change:key2', foo, context). If the widget attributes key1 and key2 are both modified, the second form will result in foo being called twice while the first will call foo only once.
Rest
...args: any[]Optional
context: anyOptional
context: anyRest
...keys: A[]For use with models as ES classes. If you define a preinitialize method, it will be invoked when the Model is first created, before any instantiation logic is run for the Model.
Optional
attributes: anyOptional
options: anySerialize widget state.
A serializer is a function which takes in a state attribute and a widget, and synchronously returns a JSONable object. The returned object will have toJSON called if possible, and the final result should be a primitive object that is a snapshot of the widget state that may have binary array buffers.
Optional
object: anyOptional
events: stringOptional
callback: EventHandlerHandle sync to the back-end. Called when a model.save() is called.
Make sure a comm exists.
method : create, update, patch, delete, read
create/update always send the full attribute set
patch - only send attributes listed in options.attrs, and if we
are queuing up messages, combine with previous messages that have
not been sent yet
model : the model we are syncing
will normally be the same as this
options : dict
the attrs
key, if it exists, gives an {attr: value} dict that
should be synced, otherwise, sync all attributes.
Optional
options: anyRest
...args: any[]Optional
eventName: stringOptional
callback: EventHandlerOptional
context: anyOptional
options: SilenceableStatic
_deserialize_Returns a promise for the deserialized state. The second argument is an instance of widget manager, which is required for the deserialization of widget models.
Static
extendGenerated using TypeDoc
Returns the relative URL where the model's resource would be located on the server.