From 17ef915ff264589710374dd4b966cb0cbfd04730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Tue, 25 Sep 2018 15:52:55 +0200 Subject: [DOC] doc: add information on session and client action --- doc/reference/javascript_cheatsheet.rst | 45 --------------------------------- 1 file changed, 45 deletions(-) (limited to 'doc/reference/javascript_cheatsheet.rst') diff --git a/doc/reference/javascript_cheatsheet.rst b/doc/reference/javascript_cheatsheet.rst index ea22e8f4715..c4d403b6b8e 100644 --- a/doc/reference/javascript_cheatsheet.rst +++ b/doc/reference/javascript_cheatsheet.rst @@ -130,51 +130,6 @@ This is usually done with code looking like this: }); -Adding a client action -====================== - -A client action is a widget which will control the part of the screen below the -menu bar. It can have a control panel, if necessary. Defining a client action -can be done in two steps: implementing a new widget, and registering the widget -in the action registry. - -- Implementing a new client action: - This is done by creating a widget: - - .. code-block:: javascript - - var ControlPanelMixin = require('web.ControlPanelMixin'); - var AbstractAction = require('web.AbstractAction'); - - var ClientAction = AbstractAction.extend(ControlPanelMixin, { - ... - }); - - Do not add the controlpanel mixin if you do not need it. Note that some - code is needed to interact with the control panel (via the - ``update_control_panel`` method given by the mixin). - -- Registering the client action: - As usual, we need to make the web client aware of the mapping between - client actions and the actual class: - - .. code-block:: javascript - - var core = require('web.core'); - - core.action_registry.add('my-custom-action', ClientAction); - - - Then, to use the client action in the web client, we need to create a client - action record (a record of the model ``ir.actions.client``) with the proper - ``tag`` attribute: - - .. code-block:: xml - - - Some Name - my-custom-action - Creating a new view (from scratch) ================================== -- cgit v1.2.3