ExtJS4 只显示年月的Field
条评论
989 ℃
Ext.define('Ext.form.field.Month', { extend:'Ext.form.field.Date', alias: 'widget.monthfield', requires: ['Ext.p...
Ext.define('Ext.form.field.Month', { extend:'Ext.form.field.Date', alias: 'widget.monthfield', requires: ['Ext.p...
如果是GRID放在其他控件里, 解决方法见 EXTJS TAB里放GRID高度自适应问题,官方PERFECT方案。
然而直接添加到 Ext.window里, 却不能用FIX的 layout来自动适应.
这里使用 事件监听的方法来动态的调整GRID高度,达到效果.
如下,在GRID控件 里监听 afterlayout 即render完毕后.
listeners:{ afterlayout: function(grid, layout) { } }
设置GRID的高度和宽度为窗口的高度和宽度
listeners:{ afterlayout: function(grid, layout) { grid.setWidth(grid.ownerCt.getWidth()); grid.setHeight(grid.ownerCt.getHeight()); } }
.ownerCt.getHeight()
获取的是 窗口整个的高度, 包括了标题和边框.
继续改进
...viewConfig:{ enableTextSelection:true }