Skip to content
Snippets Groups Projects
Commit ac1e23c8 authored by Manon Bourgognon's avatar Manon Bourgognon
Browse files

update: solid-action example

parent c4335ea4
No related branches found
No related tags found
1 merge request!90feature: add link-text attribute
.. _widgets-examples:
Examples Examples
========= =========
...@@ -178,21 +180,38 @@ solid-set-div ...@@ -178,21 +180,38 @@ solid-set-div
solid-action solid-action
~~~~~~~~~~~~ ~~~~~~~~~~~~
A classic example of solid-action use is a list of resources (users here) with only one field displayed and the possibility to access additionnal informations by clicking on "User details" :
.. code:: html .. code:: html
<solid-display <solid-display
data-src="data/list/user-4.jsonld" data-src="data/list/users.jsonld"
fields="first_name, last_name, skills" fields="name, details"
widget-skills="solid-action-label" value-details="User details"
link-text-skills="Click to see his/her skills" label-name="Name :"
label-skills="Skills :" widget-name="solid-display-value-label"
src-skills="data/list/user-4-skills.jsonld"
></solid-display> ></solid-display>
.. figure:: ../../_static/images/import_documentation/widgets-examples/widget-action.png .. figure:: ../../_static/images/import_documentation/widgets-examples/widget-action.png
:alt: Basic solid-display
This is the solid-display with action attribute and link-text-[field] attribute use to replace the basic value-[field] from above.
.. code:: html
<solid-display
data-src="data/list/users.jsonld"
fields="name, details"
label-name="Name :"
widget-name="solid-display-value-label"
action-details="user-details"
link-text-details="User details"
></solid-display>
.. figure:: ../../_static/images/import_documentation/widgets-examples/widget-action2.png
:alt: Widget solid-action :alt: Widget solid-action
By adding action attribute in the solid-display, a router, a route and another view, clicking on the solid-action displays the view (dotted border): By adding a router, a route and another view, clicking on the solid-action displays the view (dotted border):
.. code:: html .. code:: html
...@@ -200,29 +219,28 @@ By adding action attribute in the solid-display, a router, a route and another v ...@@ -200,29 +219,28 @@ By adding action attribute in the solid-display, a router, a route and another v
<solid-route <solid-route
hidden hidden
use-id use-id
name="skills-details" name="user-details"
></solid-route> ></solid-route>
</solid-router> </solid-router>
<solid-display <solid-display
data-src="data/list/user-4.jsonld" data-src="data/list/users.jsonld"
fields="first_name, last_name, skills" fields="name, details"
widget-skills="solid-action-label" label-name="Name :"
link-text-skills="Click to see his/her skills" widget-name="solid-display-value-label"
label-skills="Skills :" action-details="user-details"
src-skills="data/list/user-4-skills.jsonld" link-text-details="User details"
action-skills="skills-details"
></solid-display> ></solid-display>
<div data-view="skills-details" hidden> <div data-view="user-details" hidden>
<solid-display <solid-display
bind-resources bind-resources
fields="name" fields="first_name, last_name, username, email"
></solid-display> ></solid-display>
</div> </div>
.. figure:: ../../_static/images/import_documentation/widgets-examples/widget-action2.png .. figure:: ../../_static/images/import_documentation/widgets-examples/widget-action3.png
:alt: Widget solid-action :alt: Widget solid-action with view
Step-by-step widget creation Step-by-step widget creation
......
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