AnsweredAssumed Answered

Accessing data for a record in a subpanel

Question asked by Ken.Brill@plusconsulting.com on Mar 8, 2017
Latest reply on Mar 10, 2017 by Ken.Brill@plusconsulting.com

So, I want to disable the unlink and edit dropdown for each line of a subpanel where the current user is not the assigned user.  I have this code in custom/modules/{MODULE}/clients/base/views/subpanel-list/subpanel-list.js

 

({
    extendsFrom:'SubpanelListView',
    initialize:function(options){
        this._super('initialize',[options]);
        this.on('render',this._disableActions,this);
    },
    _disableActions:function() {
        self=this;
        _.each(this.meta.rowactions.actions, function(action){
            if(!_.isEqual(action['icon'],"fa-eye")){ // for preview button
                delete action['event'];
                action['css_class'] = 'disabled btn';
            }
        });
    }
})

This disables the controls for all rows.  I have been looking all day and so far I cannot find a way to access the assigned_to_id from each record in the subpanel.

 

Any ideas?

Outcomes