Created
August 4, 2014 19:48
-
-
Save elchele/eb3a3e07b3c0fd09a5be 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
({ | |
/* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com | |
* File: ./custom/modules/Contacts/clients/base/views/record/record.js | |
* | |
* Extended RecordView controller for applying custom | |
* RecordView metadata at initialize time (Sugar 7.2+) | |
* | |
*/ | |
extendsFrom: 'RecordView', | |
initialize: function(options){ | |
// Invoke parent controller 'initialize' method | |
this._super('initialize', [options]); | |
// obtain ID value for current user | |
var u_id = app.user.id; | |
/* if user is 'Jim', load the metadata for view 'group1', otherwise metadata | |
for RecordView is applied */ | |
if (u_id == 'seed_jim_id') | |
{ | |
/* this.meta is metadata for current view (RecordView) | |
app.metadata.getView() allows us to load metadata of another view */ | |
this.meta = app.metadata.getView(this.module, 'group1'); | |
} | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment