Announcement

Collapse
No announcement yet.

Custom action handler, menu is missing keys (actions, dropdown)

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

  • Custom action handler, menu is missing keys (actions, dropdown)

    Hi,

    I was following the custom buttons example from the docs: https://www.espocrm.com/documentatio...ustom-buttons/ but I noticed that when you are on the LIST view and click on an item to go to DETAIL an ugly error message appears from the call to show/hideHeaderActionItem.

    The first time you do list -> detail it works, then the second time, the error appears (attached).
    As far as I saw, this.menu only has 'buttons' at that time. 'actions' and 'dropdown' disappeared at some point when going back from Detail to List.

    Code:
    showHeaderActionItem: function (name) {
                ['actions', 'dropdown', 'buttons'].forEach(function (t) {.  // <<< CRASH HAPPENS HERE. actions and dropdown are not in this.menu
                    this.menu[t].forEach(function (item, i) {
                        item = item || {};
                        if (item.name == name) {
                            item.hidden = false;
                        }
                    }, this);
                }, this);
    I am on espo 5.8.4, the action handler code is basically the one from the example.
    Last edited by telenieko; 04-02-2020, 12:17 PM. Reason: Fix topic title
Working...
X