`
yiminghe
  • 浏览: 1431716 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Ext 一个聊天窗口的设计

阅读更多

1.关键是要  弹性设计,自动适应浏览器

 

部件要:


height:auto  = autoHeight:true

width:auto   = autoWidth:true


父容器要:


overflow:auto  = autoScroll : true

 

 

2. HtmlEditor 对于 ctr-enter 感应 特殊处理 ,因为他是套在一个  iframe 里的

 

 

//event for source editing mode
   new Ext.KeyMap(Ext.getCmp("htmleditor").getEl(), [
   {
        key: 13,
        ctrl:true,
        stopEvent :true,
        fn: send
    }
]);
    
    
     //event for normal mode
Ext.getCmp("htmleditor").onEditorEvent = function(e){
   this.updateToolbar();
   var keyCode = (document.layers) ? keyStroke.which : e.keyCode;
   if (keyCode == 13 && e.ctrlKey) send(); //it'a my handler
}

 

 

示例代码:

放在 example/layout/chat.html

 

  • 大小: 38.4 KB
分享到:
评论
1 楼 zqb666kkk 2012-01-05  
能否把界面代码完整的给我 最近做项目正好做到 聊天这块

相关推荐

Global site tag (gtag.js) - Google Analytics