Last active
August 4, 2016 12:49
-
-
Save betobaz/4a2a7266e7afda8e83ad to your computer and use it in GitHub Desktop.
SugarCRM: Sidecar: Multi select dependent from another multi select dependent fields
This file contains hidden or 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
<?php | |
$app_list_strings['promocion_region_list']=array ( | |
'Michoacana' => 'Michoacana', | |
'Jaliciense' => 'Jaliciense', | |
'Sinaloense' => 'Sinaloense', | |
'Sonorense' => 'Sonorense', | |
); | |
$app_list_strings['seg_geo_com_Michoacana_list']=array ( | |
'MO' => 'Morelia', | |
'UR' => 'Uruapan', | |
'ZI' => 'Zitacuaro', | |
'ZA' => 'Zamora', | |
); | |
$app_list_strings['seg_geo_com_Jaliciense_list']=array ( | |
'TL' => 'Tlaquepaque', | |
'LM' => 'Lagos', | |
'CO' => 'Colima', | |
); | |
$app_list_strings['seg_geo_com_Sinaloense_list']=array ( | |
'MZ' => 'Mazatlan', | |
'TE' => 'Tepic', | |
'MC' => 'Mochis', | |
'CU' => 'Culiacan', | |
); | |
$app_list_strings['seg_geo_com_Sonorense_list']=array ( | |
'HE' => 'Hermosillo', | |
'OB' => 'Obregon', | |
'CA' => 'Caborca', | |
); | |
$app_list_strings['promocion_sucursal_list']=array ( | |
'MO' => 'Morelia', | |
'UR' => 'Uruapan', | |
'ZI' => 'Zitacuaro', | |
'ZA' => 'Zamora', | |
'TL' => 'Tlaquepaque', | |
'LM' => 'Lagos', | |
'CO' => 'Colima', | |
'MZ' => 'Mazatlan', | |
'TE' => 'Tepic', | |
'MC' => 'Mochis', | |
'CU' => 'Culiacan', | |
'HE' => 'Hermosillo', | |
'OB' => 'Obregon', | |
'CA' => 'Caborca', | |
); |
This file contains hidden or 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: "RecordView", | |
initialize: function(){ | |
this._super('initialize', arguments); | |
var self = this; | |
this.model.on('change:region', _.bind(self._handlerSucursales, self)); | |
} | |
_handlerSucursales: function(){ | |
var self = this; | |
if(self.currentState === 'view') return; | |
var sucursal = this.getField('sucursal'); | |
if(!sucursal) return; | |
var options = {}; | |
// Obtener la listas de las companias seleccionadas | |
var values = self.model.get('region'); | |
_.each(values, function(item, index){ | |
var listStringsName = "seg_geo_com_"+item+"_list"; | |
options = _.extend(options, app.lang.getAppListStrings(listStringsName)); | |
}); | |
self.model.set('sucursal', []); | |
sucursal.items = options; | |
sucursal.render(); | |
} | |
}) |
This file contains hidden or 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
<?php | |
$dictionary['Promociones'] = array( | |
'table' => 'qs_promociones', | |
'audited' => true, | |
'activity_enabled' => false, | |
'duplicate_merge' => true, | |
'fields' => array ( | |
'region' => | |
array ( | |
'required' => false, | |
'name' => 'region', | |
'vname' => 'LBL_REGION', | |
'type' => 'multienum', | |
'massupdate' => true, | |
'default' => '', | |
'no_default' => false, | |
'comments' => '', | |
'help' => '', | |
'importable' => 'true', | |
'duplicate_merge' => 'enabled', | |
'duplicate_merge_dom_value' => '1', | |
'audited' => false, | |
'reportable' => true, | |
'unified_search' => false, | |
'merge_filter' => 'disabled', | |
'calculated' => false, | |
'size' => '20', | |
'options' => 'promocion_region_list', | |
'dependency' => '', | |
'isMultiSelect' => true, | |
), | |
'sucursal' => | |
array ( | |
'required' => false, | |
'name' => 'sucursal', | |
'vname' => 'LBL_SUCURSAL', | |
'type' => 'multienum', | |
'massupdate' => true, | |
'default' => '', | |
'no_default' => false, | |
'comments' => '', | |
'help' => '', | |
'importable' => 'true', | |
'duplicate_merge' => 'enabled', | |
'duplicate_merge_dom_value' => '1', | |
'audited' => false, | |
'reportable' => true, | |
'unified_search' => false, | |
'merge_filter' => 'disabled', | |
'calculated' => false, | |
'size' => '20', | |
'options' => 'promocion_sucursal_list', | |
'dependency' => '', | |
'isMultiSelect' => true, | |
), | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Betobaz,
I been struggling with this, but I can't figure out how to get this done. On the console I have this error:
myField.render is not a function
What do you think it could be wrong?
Thanks in advance!
Gonzalo Iglesias