Custom Actions In massActionList

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • blueprint
    Active Community Member
    • Jan 2019
    • 223

    Custom Actions In massActionList

    How can I go about adding custom actions in the `massActionList`?

    I've tried to set the `massActionList` variable inside my custom list JS file as follows:

    Code:
    massActionList: ['doSomething'],
    
    checkAllResultMassActionList: ['doSomething'],
    
    massActionDoSomething: function () {
    console.assert();
    },
    But this doesn't seem to make any difference.
    Last edited by blueprint; 01-14-2020, 04:33 PM.
  • blueprint
    Active Community Member
    • Jan 2019
    • 223

    #2
    Ok, managed to figure this one out so for anyone interested, you need to do the following:

    1. Create a custom `client\custom\src\views\<entity>\record\list.js` view
    2. Update the relevant `clientDefs.json` file to contain the following:

    Code:
    "recordViews": {
            "list": "custom:views/<entity>/record/list"
    },
    3. Add the following code to the `list.js` file:

    Code:
    Espo.define('custom:views/<entity>/record/list', 'views/record/list', function (Dep) {
    
        return Dep.extend({
    
            setup: function() {
                Dep.prototype.setup.call(this);
    
                // Set up the mass action list
                this.massActionList.push('doSomething');
    
            },
    
            massActionDoSomething: function () {
                console.log('do something here');
            },
    
        });
    });

    Comment


    • esforim
      esforim commented
      Editing a comment
      Thank you. What were you planning to do with it as that "do something" is just a placeholder right?

      Do you think it possible to Mass add documents? Upload one by one and waiting for it take too long at the moment.
  • telecastg
    Active Community Member
    • Jun 2018
    • 907

    #3
    Do you think it possible to Mass add documents? Upload one by one and waiting for it take too long at the moment.
    Here's a link that details how uploading multiple files can be accomplished, I am not sure how to adapt it to a custom view function function but with a little tinkering I am sure it would be possible. If you manage to do it please share

    $(document).ready(function () { $(document).on('click', "button", function (e) { $(this).closest('tr').remove(); }); }); var filelist = new Array(); updateList = function () { ...

    Comment


    • esforim
      esforim commented
      Editing a comment
      Out of my skill level. I will add it to the Learning CRM thread for future expert
Working...