ext6.2 如何给树菜单添加滚动条
来源:互联网 发布:如何创建网络销售平台 编辑:程序博客网 时间:2024/04/28 15:39
使用extjs6官方模板admin-dashboard的话 直接在main.js 里直接加 滚动条的属性 autoScroll:true,containerScroll : true, 是不管用的,
方法如下:xtype:mainContainerWrap 这个 替换成下面这个 从之前的一个整个大个面板变成2个小面板 让 菜单,和右边的展示 独立分开 这样子就改变了之前 他们是用一个滚动条方式了
{ //下方容器 xtype: 'container', id: 'main-view-detail-wrap', reference: 'mainContainerWrap', flex: 1, layout: { type: 'hbox', //是否支持动画效果 //用于支持菜单栏折叠/展开动画效果 animate: true, animatePolicy: { x: true, width: true } }, items: [{ //导航菜单模块 //导航栏与右侧容器的滚动条相互独立,互不干涉 height: '100%', scrollable: 'y', reference: 'navigationContainer', cls: 'navigationContainer', xtype: 'container', width: 250, //container套panle用以支持独立滚动条 items: [{ xtype: 'treelist', reference: 'navigationTreeList', itemId: 'navigationTreeList', ui: 'navigation', store: 'NavigationTree', autoScroll:true, containerScroll : true, width: 250, height:'100%', expanderFirst: false, expanderOnly: false, listeners: { selectionchange: 'onNavigationTreeSelectionChange' } }] }, { xtype: 'container', flex: 1, reference: 'mainCardPanel', cls: 'sencha-dash-right-main-container', itemId: 'contentPanel', layout: { type: 'card', anchor: '100%' } }] }由于我用的自己的store 你需要改成自己的数据源,
下一步别忘了 还有缩小菜单这个功能需要修改 因为之前源代码在MainController里的函数 onToggleNavigationSize 是会出现问题的 由于结构的改变找不到原先的属性了,这个函数需要修改成 如下
//折叠或展开导航树 onToggleNavigationSize: function () { var me = this, //获取引用对象 refs = me.getReferences(), //导航菜单 navigationList = refs.navigationTreeList, //导航菜单容器 navigationContainer = refs.navigationContainer, //下方容器 wrapContainer = refs.mainContainerWrap, //导航菜单是否折叠 collapsing = !navigationList.getMicro(), new_width = collapsing ? 64 : 250; if (Ext.isIE9m || !Ext.os.is.Desktop) { //ie9以及其他低版本浏览器处理逻辑 //停止布局处理 Ext.suspendLayouts(); // 动态设置顶部Ico宽度 refs.senchaLogo.setWidth(new_width); //动态控制左侧导航栏宽度 navigationContainer.setWidth(new_width); navigationList.setWidth(new_width); //设置菜单栏折叠状态 navigationList.setMicro(collapsing); //恢复布局 Ext.resumeLayouts(); // do not flush the layout here... // 低版本浏览无动画效果 wrapContainer.layout.animatePolicy = wrapContainer.layout.animate = null; //下方容器重新布局 wrapContainer.updateLayout(); // ... since this will flush them } else { if (!collapsing) { //如果是展开状态,调整树形导航栏样式 navigationList.setWidth(new_width); navigationList.setMicro(false); } navigationList.canMeasure = false; // 动态设置顶部Ico样式 refs.senchaLogo.animate({ dynamic: true, to: { width: new_width } }); //动态控制左侧导航栏宽度 navigationContainer.width = new_width; navigationList.width = new_width; //更新父容器布局 wrapContainer.updateLayout({ isRoot: true }); //增加动画效果 navigationList.el.addCls('nav-tree-animating'); //折叠时处理逻辑 if (collapsing) { navigationContainer.on({ afterlayoutanimation: function () { //如果是折叠状态,调整树形导航栏样式 navigationList.setMicro(true); navigationList.setWidth(new_width); navigationList.el.removeCls('nav-tree-animating'); navigationList.canMeasure = true; }, single: true }); } } }
阅读全文
0 0
- ext6.2 如何给树菜单添加滚动条
- 如何给GridView添加滚动条
- HTML如何给table添加滚动条
- HTML如何给table添加滚动条
- HTML如何给table添加滚动条
- 如何添加滚动条
- 如何给Winform 的Panel控件添加滚动条
- Android:如何给ScrollView添加滑块滚动条
- 如何给表格的tbody添加滚动条
- 笔记——如何给JTextArea添加滚动条
- 给层添加滚动条
- 给div添加滚动条
- 给DIV添加滚动条
- 给页面添加滚动条
- 给页面添加滚动条
- 给DIV添加滚动条
- 给表格添加滚动条
- 给JTextArea添加滚动条
- Remove Nth Node From End of List
- Java 数组 与 循环遍历
- ant打包脚本
- jssdk invalid signature的一个坑
- Java进阶(三)理解Java的三大特性之多态
- ext6.2 如何给树菜单添加滚动条
- nginx 启动访问不了页面
- C++ STL之List
- Cloneable接口 Object类 工具类
- linux系统运维常用命令详解二
- [ linux ] tar 解压命令
- 让我们的jsp文件可以兼容IE7/8同时还能兼容IE11代码
- jedis的操作
- ant自动包上传 部署