diff --git a/source/import_documentation/Mixins/sorter-mixin.rst b/source/import_documentation/Mixins/sorter-mixin.rst index c6a4206698b95f6cf5830c26d0fc176dade45523..c5c4644eb2e227e8e255a8662e8c75ef65b3c6bf 100644 --- a/source/import_documentation/Mixins/sorter-mixin.rst +++ b/source/import_documentation/Mixins/sorter-mixin.rst @@ -41,4 +41,34 @@ Attributes data-src="http://server/users/" fields="username" order-by-random + ></solid-display> + +``sorted-by`` +~~~~~~~~~~~~~ + + Target a ``<solid-form-search>`` used to provide several options for the user to sort current list of resource. + + The ``fields`` attribute of ``<solid-form-search>`` must at least contain ``field``. + ``Field`` attribute contains the fields of the resource to be offered to the user for sorting the data. + + ``Order`` attribute allows you to propose 2 sorting orders: ascending (``asc`) and descending (``desc``). + By default, the order is ascending. + + The ``<solid-display>`` cannot combine ``order-asc`` or ``order-desc`` attribute AND ``sorted-by`` attribute. + + example: + + .. code:: html + + <solid-form-search + id="my-sorter" + fields="field, order" + enum-field="username, email" + enum-order="ascending order = asc, descending order = desc" + ></solid-form-search> + + <solid-display + data-src="http://server/users" + fields="username, last_name, email" + sorted-by="my-sorter" ></solid-display> \ No newline at end of file diff --git a/source/import_documentation/attributes-list.rst b/source/import_documentation/attributes-list.rst index 1fde6c9e73c44895658b17ee6197b771b4d405b8..7f42901bf42bffff4fa573f178eeeea1ca6c25d9 100644 --- a/source/import_documentation/attributes-list.rst +++ b/source/import_documentation/attributes-list.rst @@ -192,6 +192,10 @@ List of attributes (core framework) ~~~~~~~~~~~~~~~~~~~~ * :ref:`required-mixin <required-mixin>` +``sorted-by`` +~~~~~~~~~~~~~~~ + * :ref:`sorter-mixin <sorter-mixin>` + ``start-value-[field]`` ~~~~~~~~~~~~~~~~~~~~~~~ * :ref:`solid-form-search <solid-form-search>`