Ext js 4 slider always show tip demo
Ext.define('AlwaysVisibleTip', {
extend: 'Ext.slider.Tip',
init: function(slider) {
var me = this;
me.callParent(arguments);
slider.removeListener('dragend', me.hide);
slider.on({
scope: me,
change: me.onSlide,
afterrender: function() {
setTimeout(function() {
me.onSlide(slider, null, slider.thumbs[0]);
}, 100);
}
});
}
});
Ext.create('Ext.slider.Single', {
width: 200,
value: 50,
increment: 1,
minValue: 0,
maxValue: 100,
plugins: [Ext.create('AlwaysVisibleTip',{
getText: function(thumb) {
return thumb.value + '%';
}
})],
tipText : function(thumb)
{
return thumb.value + '%';
},
renderTo: Ext.getBody()
});
参考:
http://www.sencha.com/forum/showthread.php?257843-Always-show-the-tip-text-of-Slider-in-Extjs
http://stackoverflow.com/questions/15198053/always-show-the-tip-text-of-slider-in-extjs
本文介绍如何在ExtJS 4中创建一个始终显示提示文本的滑块组件。通过重写Ext.slider.Tip类并移除拖动结束时隐藏提示的功能,使得滑块的提示文本始终保持可见。
5500

被折叠的 条评论
为什么被折叠?



