lino.core.elems¶
Defines "layout elements" (widgets).
(This module's source code is available here.)
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 filed-like data element. |
|
|
|
|
|
A |
|
|
|
The component that generates the JS of a grid column. |
|
Represents a Lino.GridPanel, i.e. the widget used to represent a table or a slave table. |
|
Element that renders to a Lino.HtmlBoxPanel. |
|
Widget for |
|
|
|
|
|
|
|
|
|
|
|
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. |
|
The panel used to display a slave table whose display_mode is 'summary'. |
|
|
|
|
|
|
|
|
|
|
|
|
|
-
class
lino.core.elems.
GridColumn
(layout_handle, index, editor, **kw)¶ Bases:
lino.utils.jsgen.Component
The component that generates the JS of a grid column.
-
class
lino.core.elems.
FieldElement
(layout_handle, field, hide_sum=False, **kw)¶ Bases:
lino.core.elems.LayoutElement
Base class for all Widgets on some filed-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:
lino.core.elems.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:
lino.core.elems.CharFieldElement
Widget for
lino.core.fields.IncompleteDate
fields.
-
class
lino.core.elems.
NumberFieldElement
(layout_handle, field, hide_sum=False, **kw)¶ Bases:
lino.core.elems.FieldElement
Base class for integers, decimals, RequestField,...
-
class
lino.core.elems.
DisplayElement
(*args, **kw)¶ Bases:
lino.core.elems.FieldElement
ExtJS element to be used for
DisplayFields
.
-
class
lino.core.elems.
SingleRelatedObjectElement
(lh, relobj, **kw)¶ Bases:
lino.core.elems.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:
lino.core.elems.DisplayElement
A
DisplayElement
specially adapted to a GFK field.
-
class
lino.core.elems.
HtmlBoxElement
(*args, **kw)¶ Bases:
lino.core.elems.DisplayElement
Element that renders to a Lino.HtmlBoxPanel.
-
class
lino.core.elems.
SlaveSummaryPanel
(lh, actor, **kw)¶ Bases:
lino.core.elems.HtmlBoxElement
The panel used to display a slave table whose display_mode is 'summary'.
Note that this creates an automatic VirtualField which is a bit special because it is created during
create_layout_element()
after the startup analysis.
-
class
lino.core.elems.
Wrapper
(e, **kw)¶
-
class
lino.core.elems.
Container
(layout_handle, name, *elements, **kw)¶ Bases:
lino.core.elems.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:
lino.core.elems.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:
lino.core.elems.Container
Represents a Lino.GridPanel, i.e. the widget used to represent a table or a slave table.
-
class
lino.core.elems.
ParamsPanel
(layout_handle, name, vertical, *elements, **kw)¶ Bases:
lino.core.elems.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:
lino.core.elems.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.