Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More
lino.core.elems¶
Defines “layout elements” (widgets).
Functions
|
|
|
|
|
Create a layout element from the named data element. |
|
This also must translate ui-agnostic parameters like label_align to their ExtJS equivalent labelAlign. |
|
|
|
|
|
Create the appropriate layout element for the given database field. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Classes
|
The optional Panel for parameters of an Action. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Like |
|
|
|
|
|
|
|
|
|
|
|
Base class for Layout Elements that can contain other Layout Elements: |
|
|
|
|
|
|
|
|
|
|
|
ExtJS element to be used for |
|
|
|
Base class for all Widgets on some field-like data element. |
|
|
|
|
|
A |
|
|
|
The component that generates the JS of a grid column. |
|
Represents a Lino.GridPanel, i.e. the widget used to render a table in grid mode. |
|
Element that renders to a Lino.HtmlBoxPanel. |
|
Widget for |
|
|
|
|
|
Renders plain html usually generated by HtmlBox fields. |
|
|
|
|
|
|
|
|
|
Base class for integers, decimals, RequestField,... |
|
A vertical Panel is vflex if and only if at least one of its children is vflex. |
|
The optional Panel for parameters of a Table. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The widget used to render a SingleRelatedObjectDescriptor, i.e. the other side of a OneToOneField. |
|
Container for a slave table in case it has width dependent layout |
|
The panel used to display a slave table when display_mode is DISPLAY_MODE_SUMMARY. |
|
|
|
The panel used to display objects as plain html generated by |
|
|
|
|
|
|
|
|
|
|
|
- class lino.core.elems.GridColumn(layout_handle, index, editor, **kw)¶
Bases:
Component
The component that generates the JS of a grid column.
- class lino.core.elems.FieldElement(layout_handle, field, hide_sum=False, **kw)¶
Bases:
LayoutElement
Base class for all Widgets on some field-like data element.
- value_from_object(obj, ar)¶
Wrapper around Django’s value_from_object. But for virtual fields it also forwards the action request ar.
- value2html(ar, v, **cellattrs)¶
Return a <td> html etree element representing the given value.
The default implementation returns an HTML element obtained from
format_value()
.
- format_sum(ar, sums, i)¶
Return a string or an html element which expresses a sum of this column.
- Ar:
the action request
- Sums:
a list of sum values for all columns of this ar
- I:
the index of this field in sums
- class lino.core.elems.ChoiceListFieldElement(layout_handle, field, **kw)¶
Bases:
ChoicesFieldElement
Like
ChoicesFieldElement
, but we use the fact that choicelists are actors to define them once and refer to them. Special case are choicelist fields with blank=True: these must dynamicaly add a blank choice to the the choicelist.
- class lino.core.elems.IncompleteDateFieldElement(*args, **kw)¶
Bases:
CharFieldElement
Widget for
lino.core.fields.IncompleteDate
fields.
- class lino.core.elems.NumberFieldElement(layout_handle, field, hide_sum=False, **kw)¶
Bases:
FieldElement
Base class for integers, decimals, RequestField,…
- class lino.core.elems.DisplayElement(*args, **kw)¶
Bases:
FieldElement
ExtJS element to be used for
DisplayFields
.
- class lino.core.elems.SingleRelatedObjectElement(lh, relobj, **kw)¶
Bases:
DisplayElement
The widget used to render a SingleRelatedObjectDescriptor, i.e. the other side of a OneToOneField.
- class lino.core.elems.GenericForeignKeyElement(layout_handle, field, **kw)¶
Bases:
DisplayElement
A
DisplayElement
specially adapted to a GFK field.
- class lino.core.elems.HtmlBoxElement(*args, **kw)¶
Bases:
DisplayElement
Element that renders to a Lino.HtmlBoxPanel.
- class lino.core.elems.LightWeightContainer(lh, slave, name, return_type, **kwargs)¶
Bases:
HtmlBoxElement
Renders plain html usually generated by HtmlBox fields.
This creates an automatic VirtualField, which is special because it happens “dynamically” after the startup analysis, during
create_layout_element()
.
- class lino.core.elems.SlaveSummaryPanel(lh, slave, name, **kw)¶
Bases:
LightWeightContainer
The panel used to display a slave table when display_mode is DISPLAY_MODE_SUMMARY.
- class lino.core.elems.StoryElement(lh, slave, name, **kw)¶
Bases:
LightWeightContainer
The panel used to display objects as plain html generated by
as_summary_row
when display_mode is DISPLAY_MODE_STORY.
- class lino.core.elems.Container(layout_handle, name, *elements, **kw)¶
Bases:
LayoutElement
Base class for Layout Elements that can contain other Layout Elements:
Panel
,TabPanel
,FormPanel
,GridPanel
- get_view_permission(user_type)¶
A Panel which doesn’t contain a single visible element becomes itself hidden.
- class lino.core.elems.Panel(layout_handle, name, vertical, *elements, **kw)¶
Bases:
Container
A vertical Panel is vflex if and only if at least one of its children is vflex. A horizontal Panel is vflex if and only if all its children are vflex (if vflex and non-vflex elements are together in a hbox, then the vflex elements will get the height of the highest non-vflex element).
- class lino.core.elems.GridElement(layout_handle, name, rpt, *columns, **kw)¶
Bases:
Container
Represents a Lino.GridPanel, i.e. the widget used to render a table in grid mode.
- class lino.core.elems.SlaveContainer(layout_handle, name, rpt, *columns, **kw)¶
Bases:
GridElement
Container for a slave table in case it has width dependent layout
- class lino.core.elems.ParamsPanel(layout_handle, name, vertical, *elements, **kw)¶
Bases:
Panel
The optional Panel for parameters of a Table. JS part stored in Lino.GridPanel.params_panel.
- class lino.core.elems.ActionParamsPanel(layout_handle, name, vertical, *elements, **kw)¶
Bases:
Panel
The optional Panel for parameters of an Action.
- lino.core.elems.field2elem(layout_handle, field, **kw)¶
Create the appropriate layout element for the given database field.
- lino.core.elems.create_layout_panel(lh, name, vertical, elems, **kwargs)¶
This also must translate ui-agnostic parameters like label_align to their ExtJS equivalent labelAlign.
- lino.core.elems.create_layout_element(lh, name, **kw)¶
Create a layout element from the named data element.