首页 > Web开发 > 详细

Ext js 4 slider always show tip demo

时间:2014-02-14 14:52:30      阅读:780      评论:0      收藏:0      [点我收藏+]

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()
});


bubuko.com,布布扣


参考:

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




Ext js 4 slider always show tip demo

原文:http://blog.csdn.net/helloworlddream/article/details/19166311

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!