`
czpae86
  • 浏览: 713578 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

表情选择扩展

 
阅读更多

 

/**
 * 表情扩展
 * @param {} config
 */
EmoteChooser = function(cfg){ 
	this.width=340;
	this.height=112;
	this.autoScroll=true;
	Ext.apply(this,cfg);	
    this.emoteView = new Ext.DataView({
        store: new Ext.data.ArrayStore({
	        fields: ['name'],
	        data : [//表情列表  
		        ["001"],["004"],["005"],["006"],["007"],["008"],["009"],["010"],["011"], 
		        ["012"],["016"],["021"],["022"],["023"],["024"],["025"],["028"],["030"],
		        ["002"],["003"],["013"],["026"],["014"],["015"],
		        ["017"],["018"],["019"],["020"],["027"],["029"]
		    ]
	    }),
	    tpl: new Ext.XTemplate(
			'<tpl for=".">',
			    '<div class="emotes"><img src="resources/face/{name}.gif" title="{name}"></div>',
	        '</tpl>'
		),
        autoHeight:true,
        singleSelect: true,
        overClass:'x-view-over',
        itemSelector:'div.emotes',
        listeners : {
        	'click': this.selectEmoteFn
        }
    });
    EmoteChooser.superclass.constructor.call(this, {
    	border : false,
    	items : this.emoteView
    }); 
    this.emoteView.on('click',function(){
    	this.ownerCt.hide();
    },this);
}; 
Ext.extend(EmoteChooser, Ext.Panel, {
    selectEmoteFn : function(dc,num){}
}); 
Ext.reg('emotechooser', EmoteChooser); 

 

使用例子:

 

{text:'表情',scope:this,menu:new Ext.menu.Menu({
				items : new EmoteChooser({
					selectEmoteFn : this.selectEmoteFn.createDelegate(this)
				})
			})}
 



  • 大小: 76.4 KB
  • 大小: 54.2 KB
分享到:
评论
7 楼 cencai09 2012-10-10  
czpae86 写道
cencai09 写道
请问下那个聊天记录的表格是用gridpanel吗? 我怎么没找到有这种显示的格式,请赐教!!!


这是一个panel


那分页工具栏又是怎么实现的,不会是每次都要查询了2次吧? 别那么吝啬撒,指点指点思密达
6 楼 czpae86 2012-10-09  
cencai09 写道
请问下那个聊天记录的表格是用gridpanel吗? 我怎么没找到有这种显示的格式,请赐教!!!


这是一个panel
5 楼 cencai09 2012-10-09  
求解!!!
4 楼 cencai09 2012-09-25  
请问下那个聊天记录的表格是用gridpanel吗? 我怎么没找到有这种显示的格式,请赐教!!!
3 楼 cencai09 2012-09-21  
41.Ext.extend(EmoteChooser, Ext.Panel, { 
42.    selectEmoteFn : function(dc,num){} 
43.});  
这里不是定义了吗? 有没有完整点的例子啊,学习学习!
2 楼 czpae86 2012-09-21  
cencai09 写道
1.{text:'表情',scope:this,menu:new Ext.menu.Menu({ 
2.                items : new EmoteChooser({ 
3.                    selectEmoteFn : this.selectEmoteFn.createDelegate(this) 
4.                }) 
5.            })} 

其中Cannot call method 'createDelegate' of undefined  求解!



selectEmoteFn有没有定义??
1 楼 cencai09 2012-09-20  
1.{text:'表情',scope:this,menu:new Ext.menu.Menu({ 
2.                items : new EmoteChooser({ 
3.                    selectEmoteFn : this.selectEmoteFn.createDelegate(this) 
4.                }) 
5.            })} 

其中Cannot call method 'createDelegate' of undefined  求解!

相关推荐

Global site tag (gtag.js) - Google Analytics