disable massAction by View Setup Handlers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • trungtvmso
    Member
    • Jun 2022
    • 70

    disable massAction by View Setup Handlers

    I'm trying to disable massAction on all entity record/list views by Views setup handler but unfortunately that it could not work.

    This is my custom code, please help me to correct if it has any incorrect line:

    PHP Code:
    define('custom:views/record/list', [], () => {
        class Handler {
            /**
             * @param {import('view').default} view
             */
          
            constructor(view) {
                this.view = view;
            }
          
            process() {
                this.listenTo(this.view, 'after:render', () => {
                    this.view.rowActionsDisabled = true;
                    this.view.massActionsDisabled = true;
                });
            }
        }
        // Establish event support.
        Object.assign(Handler.prototype, Backbone.Events);
        return Handler;
    });
  • trungtvmso
    Member
    • Jun 2022
    • 70

    #2
    I have done this already.

    This is my adding script to disable checkboxes
    PHP Code:
     this.view.checkboxes = false; 
    

    Comment

    Working...