Last active
December 24, 2015 11:26
-
-
Save shijinkrishna/c5b79492254bdf37bce3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
extendsFrom: 'RelateField', | |
initialize: function(options) { | |
this._super('initialize', [options]); | |
}, | |
openSelectDrawer: function() { | |
var filterOptions = new app.utils.FilterOptions() | |
.config({ | |
'initial_filter': 'FilterCoursesTemplate', | |
'initial_filter_label': 'LBL_FILTER_COURSES_TEMPLATE', | |
'filter_populate': { | |
'accounts_courses_accounts_ida': this.model.get('accounts_enrollments_accounts_ida'), | |
} | |
}) | |
.format(); | |
//this custom code will effect for all relate fields in Enrollment module.But we need initial filter only for Courses relate field. | |
filterOptions = (this.getSearchModule() == "Courses") ? filterOptions : this.getFilterOptions(); | |
app.drawer.open({ | |
layout: 'selection-list', | |
context: { | |
module: this.getSearchModule(), | |
fields: this.getSearchFields(), | |
filterOptions: filterOptions, | |
} | |
}, _.bind(this.setValue, this)); | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment