Created
June 12, 2012 13:50
-
-
Save silviot/2917623 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
Ext.define('RIP.LabeledSlider',{ | |
/* A slider that shows its value next to it*/ | |
extend: 'Ext.field.Slider', | |
xtype: 'labeledslider', | |
updateToolTip: function() { | |
this.valuediv.innerHTML = this.getValue(); | |
}, | |
reset: function() { | |
this.callParent(arguments); | |
this.updateToolTip(); | |
}, | |
config: { | |
listeners: { | |
initialize: function() { | |
this.element.appendChild(Ext.Element.create({ | |
'tag':'div', class:'sliderValue', html:0, | |
'style': 'font-weight: bold; padding: 18px 11px; width:2.5em' | |
})); | |
this.valuediv = this.element.query('.sliderValue')[0]; | |
this.getComponent().on({ | |
scope: this, | |
drag: 'updateToolTip' | |
}); | |
this.on({ | |
scope: this, | |
change: 'updateToolTip', | |
show: 'updateToolTip' | |
}); | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment