Skip to content

Instantly share code, notes, and snippets.

@srsad
Last active May 18, 2018 11:54
Show Gist options
  • Save srsad/a5942302063e0ca0c610e0911a379c96 to your computer and use it in GitHub Desktop.
Save srsad/a5942302063e0ca0c610e0911a379c96 to your computer and use it in GitHub Desktop.
kosherMap.combo.Class = function (config) {
config = config || {};
Ext.applyIf(config, {
name: 'class',
hiddenName: 'class',
editable: true,
store: new Ext.data.ArrayStore({
id: 0,
fields: ['id','name','src'],
data: [[1, 'Stadium', 'ball_rus.png'], [2, 'Mikva', 'mikva.png'], [3, 'Shabbat', 'shabat.png'], [4, 'Shop', 'shop.png'], [5, 'Synagogue', 'sinagoga.png']]
}),
tpl: new Ext.XTemplate('<tpl for="."><div class="x-combo-list-item">' +
'<img src="' + kosherMap.config.img_url + '{src}" style="width: 22px"> {name}' +
'</div></tpl>'),
mode: 'local',
displayField: 'name',
valueField: 'id'
});
kosherMap.combo.Class.superclass.constructor.call(this, config);
};
Ext.extend(kosherMap.combo.Class, MODx.combo.ComboBox);
Ext.reg('superselectboxicon', kosherMap.combo.Class);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment