Skip to content
Snippets Groups Projects
Commit 45533eba authored by Matthieu Fesselier's avatar Matthieu Fesselier
Browse files

update: add solid-table and autosave

parent adcd9062
No related branches found
No related tags found
2 merge requests!47solid-table and sorted-by,!45update: add solid-table and autosave
...@@ -118,6 +118,13 @@ Attributes ...@@ -118,6 +118,13 @@ Attributes
Equal to the value ``off``, it cancels the automatic entry of values in the relevant ``[field]``. Equal to the value ``off``, it cancels the automatic entry of values in the relevant ``[field]``.
It can be added to ``inputs``, ``textarea`` and ``select``. It can be added to ``inputs``, ``textarea`` and ``select``.
``autosave``
~~~~~~~~~~~~
*Available from version 0.16*
If the attribute is defined, each change in an input will trigger a request to update the resource.
This attribute works only when editing resources, not creating them.
Widgets Widgets
------- -------
By default, the widget used is ``<solid-form-label-text>``. Cf the By default, the widget used is ``<solid-form-label-text>``. Cf the
......
.. _solid-table:
solid-table
=============
*Available from version 0.16*
Receives the URL of a resource or of a container of resources via its
``data-src`` attribute, and displays it in a `table`. Each resource is a line (``<tr>``)
and each field is a cell (``<td>``).
Like for the ``solid-display``, custom widgets can be specified for each
field. Filters and searching capabilities can be easily
added to interact with the list of data being displayed.
.. code:: html
<solid-table
data-src="https://server/users/"
fields="first_name, last_name"
></solid-table>
Mixins
------
This component uses the following mixins:
* :ref:`required-mixin <required-mixin>`
* :ref:`counter-mixin <counter-mixin>`
* :ref:`federation-mixin <federation-mixin>`
* :ref:`filter-mixin <filter-mixin>`
* :ref:`grouper-mixin <grouper-mixin>`
* :ref:`highlighter-mixin <highlighter-mixin>`
* :ref:`list-mixin <list-mixin>`
* :ref:`paginate-mixin <paginate-mixin>`
* :ref:`sorter-mixin <sorter-mixin>`
* :ref:`store-mixin <store-mixin>`
* :ref:`widget-mixin <widget-mixin>`
Please check their documentation to know more about their capabilities.
Attributes
----------
``fields``
~~~~~~~~~~
By default, all displayed fields are direct children of
``<solid-display>``. Make sure you don’t give your set the same name as
a field as it would result in an infinite loop.
``header``
~~~~~~~~~~
If defined, adds a header line at the top of the table.
You can customize each header by setting a ``label-[field]`` attribute.
``selectable``
~~~~~~~~~~~~~~
If defined, adds checkboxes at the beginning of each line.
If the ``header`` attribute is defined, a checkbox will also be added to the headline
to select/unselect all the lines.
You have access to the selected lines in Javascript, like this:
.. code:: javascript
document.querySelector('solid-table').component.selectedLines
// returns [ "resourceId1", "resourceId2" ]
``editable-[field]``
~~~~~~~~~~~~~~~~~~~~
Makes a cell editable by creating a solid-form in the cell.
This form will be saved automatically when a change is detected.
You can customize the attributes of the form by setting them like this:
.. code:: html
<solid-table
data-src="https://server/users/"
fields="first_name"
editable-first_name
widget-first_name="solid-form-placeholder-text"
placeholder-first_name="Your First Name"
></solid-table>
Widgets
-------
By default, the widget used is ``<solid-display-value>``. Cf the
`Widget <https://docs.startinblox.com/import_documentation/Widgets/Reference.html>`__ page for more info.
...@@ -41,6 +41,7 @@ Welcome to Startinblox's documentation ...@@ -41,6 +41,7 @@ Welcome to Startinblox's documentation
import_documentation/Components/Solid-Ac-Checker import_documentation/Components/Solid-Ac-Checker
import_documentation/Components/Solid-Widget import_documentation/Components/Solid-Widget
import_documentation/Components/Solid-Lang import_documentation/Components/Solid-Lang
import_documentation/Components/Solid-Table
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment