We have a select field and the available options are depending: in edit view I use all, in create view they must be filtered.
I tried different ways but nothing works. For example to filter the list before rendering. I have no idea to access the list.
({ extendsFrom: 'CreateActionsView',
initialize: function (options) {
this._super('initialize', [options]);
this._filterRtQueue();
},
_filterRtQueue : function() {
//TODO remove some entries from select list
//console.info(this.app.metadata.getStrings('rt_queue_list'));
}
});
Or after rendering. I can't manipulate the HTML this way, the result is undefined:
({ extendsFrom: 'CreateActionsView',
initialize: function (options) {
this._super('initialize', [options]);
//this._filterRtQueue();
},
_filterRtQueue : function() {
console.log(this.$('.select2-result'));
},
_render : function() {
this._super("_render");
this._filterRtQueue();
}
});
Any idea?