AnsweredAssumed Answered

Drawer onClose Callback Modification with bind

Question asked by insxch on Dec 13, 2018

Platform is Sugar Enterprise 8.0.1 On Premise

 

I'm trying to modify a Relate field drawer to do some extra lookups after it closes via the callback. Right now the stock callback is the _.bind method:

            app.drawer.open({
                layout: 'selection-list',
                context: {
                    module: this.getSearchModule(),
                    fields: this.getSearchFields(),
                    filterOptions: filterOptions,
                }
            }, _.bind(this.setValue, this));

 

How can I get the data to still bind when the drawer closes, as well as run additional code, like so:

            app.drawer.open({
                layout: 'selection-list',
                context: {
                    module: this.getSearchModule(),
                    fields: this.getSearchFields(),
                    filterOptions: filterOptions,
                }
            }, function() {
                _.bind(this.setValue, this);
                console.log('In onClose callback.');
               });

 

I'm not sure if this is a simple fix or requires a lot more overriding of Javascript methods. Thanks!

Outcomes