您当前的位置: 首页 >  .net

[Ext.Net] 1.x GridPanel列数过多给Menu菜单加滚动条

发布时间:2013-07-01 08:05:50 ,浏览量:0

转自:http://www.ext.net.cn/thread-1944-1-2.html

当GirdPanel列数过多,查看列的显示隐藏时会出现下面下面情况,有部分超出了界面被遮罩住了

33.jpg  要解决这个问题,可通过给菜单加滚动条属性,代码如下 function ready() {             Ext.override(Ext.menu.Menu, {                 showAt: function (xy, parentMenu, _e) {                     this.parentMenu = parentMenu;                     if (!this.el) {                         this.render();                     }                     if (_e !== false) {                         this.fireEvent("beforeshow", this);                         xy = this.el.adjustForConstraints(xy);                     }                     this.el.setXY(xy);                     var maxHeight = Ext.getBody().getHeight() - xy[1];                     if (this.el.getHeight() > maxHeight) {                         this.el.setHeight(maxHeight);                         this.el.applyStyles('overflow-y: auto;');                     }                     this.el.show();                     this.hidden = false;                     this.focus();                     this.fireEvent("show", this);                 },                 autoWidth: function () {                     if (/^\d+$/.test(this.width + '')) {                         this.width += "px";                     }                 }             });         } 在DocumentReady时调用                                        ext:resourcemanager> 效果图如下: 55.jpg
关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    106169博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.4293s