Announcement

Collapse
No announcement yet.

How to create a new side panel for an entity?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to create a new side panel for an entity?

    How can I create a new side panel? I want to add a new panel to Accounts. I want to show some fields from the currently loaded entity.
    Ps. Is it possible to create a layout for my side panel that can be managed with Layout Manager like the Detail(Small)?
    Click image for larger version

Name:	vivaldi_2019-03-24_14-56-45.png
Views:	1182
Size:	56.3 KB
ID:	47205


  • #2
    Maybe this will help:

    I have a "Property" entity that is linked to a "Tenancy" entity in a one-to-many relationship.

    In "Property" detail view, a list of "Tenancies" is shown in a side panel, similar to the way "Tasks" can be displayed in side panel.

    This is how I did it:

    1) Add a custom side panel in the "Property" clientDefs file

    @ custom/Espo/Custom/Resources/metadata/clientDefs/Tenancy.json
    Code:
        "sidePanels": {
            "detail": [
                {
                    "name": "tenancies",
                    "label": "Tenancies",
                    "view": "views/record/panels/relationship",
                    "aclScope": "Tenancy"
                },
    ...
    2) Add the custom side panel to the "Property" side panels detail layout file

    @ custom/Espo/Custom/Resources/layouts/Property/sidePanelsDetail.json
    Code:
    {
        "tenancies": {
            "index": 1
        },
    ...
    3) I used the default relationship presentation inside the side panel, but to modify the data and presentation inside the side panel, you would need to create a custom view to replace "views/record/panels/relationship" (client/src/views/record/panels/relationship.js) and create a custom template to replace "record/panels/relationship" (client/res/templates/record/panels/relationship.tpl) called inside "views/record/panels/relationship".

    See how it is done for Tasks at client/modules/crm/src/views/record/panels/tasks.js

    Cheers
    Last edited by telecastg; 03-25-2019, 04:10 PM.

    Comment


    • #3
      Thanks, once I'm done I will post the result here so that this can be linked to for future use.

      Comment

      Working...
      X