Controls
Every Control implemented in Python as a javascript class responsible for handling the Control in the client side. All these controls inherit from the ControlBase class.
- class ControlBase(name, properties)
ControlBase class implements the basic control functionalities.
- Arguments
name (
string()
) – Name of the control.properties (
string()
) – Properties of the control.
- ControlBase.after_init_control()
Function called after the init_control function. It applies the controls most common configurations.
- ControlBase.app_id()
Widget id.
- Returns
string – .
- ControlBase.apply_deserialization(data)
- Function called after the deserialization of the server data.
It applies the controls most common configurations.
- Arguments
data (
object()
) – Data sent by the server.
- ControlBase.control_id()
Control id.
- Returns
string – .
- ControlBase.deserialize(data)
- Deserialize the data from the server.
This function is called at the initialization of the control and everytime data is received from the server.
- Arguments
data (
object()
) – Data sent by the server.
- ControlBase.disable()
Disable the control.
- ControlBase.enable()
Enable the control.
- ControlBase.get_value()
Get the value of the control.
- Returns
jquery – .
- ControlBase.hide()
Hide the control.
- ControlBase.init_control()
Function called to initialize the control html and events.
- ControlBase.init_help()
Get the help text as a tag.
- Returns
string – .
- ControlBase.jquery()
JQuery object of the control html.
- Returns
jquery – .
- ControlBase.jquery_place()
JQuery object of the div where the control is placed.
- Returns
jquery – .
- ControlBase.place_id()
Div id where the control is placed.
- Returns
string – .
- ControlBase.serialize()
Serializes the control data to send back to the server.
- Returns
object – .
- ControlBase.set_css(css)
Sets the css classes for the control. Previously added classes will be removed.
- Arguments
css (
string()
) – String with the css classes to add.
- ControlBase.set_field_css(css)
Sets the css classes for the field where the control is. Previously added classes will be removed.
- Arguments
css (
string()
) – String with the css classes to add.
- ControlBase.set_inline()
Set the label inline.
- Returns
string – .
- ControlBase.set_label(value)
Sets the label of the control.
- Arguments
value (
string()
) – Label to set.
- ControlBase.set_required(value)
Sets the label of the control.
- Arguments
value (
string()
) – Label to set.
- ControlBase.set_value(value)
Sets the value of the control.
- Arguments
value (
object()
) – Value to set.
- ControlBase.show()
Show the control.
- ControlBase.update_server()
- Function called before the serialization.
It is used to decide if the control should be updated in the server.