Skip to content

Instantly share code, notes, and snippets.

@hansek
Created February 28, 2013 11:30
Show Gist options
  • Save hansek/5056117 to your computer and use it in GitHub Desktop.
Save hansek/5056117 to your computer and use it in GitHub Desktop.
Custom ExtJS 3.4 components definitions for MODX Revolution.
var COEX = function(config) {
config = config || {};
COEX.superclass.constructor.call(this, config);
};
Ext.extend(COEX, Ext.Component, {
page: {},
window: {},
grid: {},
tree: {},
panel: {},
combo: {},
config: {}
});
Ext.reg('coex', COEX);
COEX = new COEX();
//=============================================================================
// Custom components definition
COEX.combo.Boolean = function(config) {
config = config || {};
Ext.applyIf(config, {
store: new Ext.data.SimpleStore({
fields: ['d', 'v'],
data: [
[_('yes'), 1],
[_('no'), 0]
]
}),
displayField: 'd',
valueField: 'v',
mode: 'local',
triggerAction: 'all',
editable: false,
selectOnFocus: false,
preventRender: true,
forceSelection: true,
enableKeyEvents: true
});
COEX.combo.Boolean.superclass.constructor.call(this,config);
};
Ext.extend(COEX.combo.Boolean, MODx.combo.ComboBox);
Ext.reg('coex-combo-boolean', COEX.combo.Boolean);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment