Announcement

Collapse
No announcement yet.

How to add filter for enum field in custom view

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

  • How to add filter for enum field in custom view

    Hi, I need to add a filter for an enum filed in a custom view in getSelectedFilter function.

    Here is my custom view and attached image:

    Espo.define('custom:views/rapportini/fields/contratti', 'views/fields/link', function (Dep) {

    return Dep.extend({

    getSelectFilters: function () {
    if (this.model.get('accountId')) {
    return {
    'account': {
    type: 'equals',
    attribute: 'accountId',
    value: this.model.get('accountId'),
    data: {
    type: 'is',
    nameValue: this.model.get('accountName')
    }
    },
    'stato':{
    type: 'equals',
    attribute: 'stato',
    value: this.model.get('stato'),
    data: {
    type: 'anyOf',
    nameValue: 'aperto'
    }
    }
    };
    }
    },

    getCreateAttributes: function () {
    if (this.model.get('accountId')) {
    return {
    accountId: this.model.get('accountId'),
    accountName: this.model.get('accountName'),
    }
    }
    }
    Attached Files
    Last edited by darkstar2000; 04-22-2021, 08:11 AM.
Working...
X