Ext js 4 slider always show tip demo

来源:互联网 发布:好奇心探索 知乎 编辑:程序博客网 时间:2024/05/16 12:14

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



0 0
原创粉丝点击