Skip to content

Instantly share code, notes, and snippets.

@slackorama
Created March 29, 2011 17:11
Show Gist options
  • Save slackorama/892785 to your computer and use it in GitHub Desktop.
Save slackorama/892785 to your computer and use it in GitHub Desktop.
// create a toggler link...is there a better way?
var toggler = new Ext.BoxComponent({
autoEl: {
tag: 'a',
href: '#',
html: 'All'
},
listeners: {
'render': function(comp) {
var el = comp.getEl();
el.on({
'click': {
scope: comp,
fn: function(event, element) {
event.stopEvent();
var text = this.getEl().dom.innerHTML;
text = text.toggle('All', 'None');
this.update(text);
}
}
});
}
},
renderTo: Ext.getBody()
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment