Skip to content

Instantly share code, notes, and snippets.

@AjayKumar01
Last active October 3, 2016 20:34
Show Gist options
  • Save AjayKumar01/cd45a5f64ac0e4eaa6bc994af473b929 to your computer and use it in GitHub Desktop.
Save AjayKumar01/cd45a5f64ac0e4eaa6bc994af473b929 to your computer and use it in GitHub Desktop.
({
extendsFrom: 'RelateField',
initialize: function(options) {
this._super('initialize', [options]);
},
getFilterOptions: function(force) {
if (this._filterOptions && !force) {
return this._filterOptions;
}
//Defining our filter definitions
var custom_FilterOptions = new app.utils.FilterOptions().config({
'initial_filter': 'FilterAccountTemplate',
'initial_filter_label': 'LBL_FILTER_ACCOUNT_TEMPLATE',
'filter_populate': {
'name': [this.model.get('name')],
}
}).populateRelate(this.model).format();
//Assigning our filter definitions
this._filterOptions = custom_FilterOptions;
return this._filterOptions;
},
openSelectDrawer: function() {
app.drawer.open({
layout: 'selection-list',
context: {
module: this.getSearchModule(),
fields: this.getSearchFields(),
filterOptions: this.getFilterOptions()
}
}, _.bind(this.setValue, this));
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment