当extjs的grid加载到window中时引发的血案
2013-04-25 20:38
369 查看
今天需要用到一个extjs的window控件中内嵌grid。本来一个很简单的功能,没想到最后做下来,花了我不少时间,真是很郁闷啊。
不多说了,先看图。
正常效果:
出错情况:
最后研究下来,原来是要先定义grid,在定义window,也是先后顺问题,如果把gridTest定义放在window之后,最后出现上图出错情况,后过来就正常了。
看代码:
不多说了,先看图。
正常效果:
出错情况:
最后研究下来,原来是要先定义grid,在定义window,也是先后顺问题,如果把gridTest定义放在window之后,最后出现上图出错情况,后过来就正常了。
看代码:
var gridTest = new Ext.grid.GridPanel({ region: 'north', border: false, columns: [ { text: "条码", width: 100, dataIndex: 'BarCode' , sortable: true }, { text: "名称", width: 120, dataIndex: 'GoodsName' , sortable: true }, { text: "数量", width: 60, dataIndex: 'Quantity' , sortable: true }, { text: "单位", width: 60, dataIndex: 'GoodsUnit' , sortable: true }, { text: "进价", width: 60, dataIndex: 'GoodsBuyPrice' , sortable: true }, { text: "售价", width: 60, dataIndex: 'GoodsSellPrice' , sortable: true }, { text: "存放位置" , width: 120, dataIndex: 'WareHouse', sortable: true }, { text: "供应商" , width: 100, dataIndex: 'SupplierName', sortable: true }, { text: "进货员" , width: 100, dataIndex: 'Employee', sortable: true }, { text: "状态", width: 60, dataIndex: '_StrStatus' , sortable: true }, { text: "入库日期" , width: 80, dataIndex: '_DtCreate', sortable: true } ], width: 700, height: 500, frame: true }); var winChooseGoods = new Ext.Window({ title: '进货', layout: 'border', width: 700, height: 500, closeAction: 'hide', plain: true, items: [gridTest], buttons: [{ text: '确定', handler: function () { winChooseGoods.close(); } }, { text: '取消', tabIndex: 12, handler: function () { winChooseGoods.close(); } }] });
相关文章推荐
- extjs中grid数据重新加载
- ExtJS动态改变grid的store的url地址,重新加载grid的数据
- ExtJS GridPanel动态加载列
- EXTjs loadRecord方法 将grid中的数据 加载到form表单中去
- NHibernate3.2+Asp.net MVC3+Extjs 4.0.2项目实践(六):Extjs Grid,Window,Form实现增删改操作
- extjs之隔行变色和grid加载时的等待
- ExtJs中Grid加载数据的超时时间的设置(作者:贝壳 )
- Extjs 动态改变grid的store加载路由
- ExtJS入门教程05,grid的异步加载数据
- Extjs Grid 字段因为json数值前空格加载失败
- Extjs的grid的单元格中加载超链接和按钮
- ExtJs中grid分页加载的问题
- Extjs的grid的单元格中加载超链接和按钮
- ExtJs 实现动态加载grid完整示例
- EXTJS中Gridpanel加载checkbox的使用方法
- Extjs 4 grid中的checkbox的加载时预选中【默认选中】
- Extjs的grid的单元格中加载超链接和按钮
- Extjs从grid加载数据到formPanel中combox不显示text
- Extjs 动态改变grid的store加载路由
- Extjs 4 grid中的checkbox的加载时预选中【默认选中】