![图片说明](https://img-ask.csdn.net/upload/201506/30/1435639352_775795.jpg)
在var grid 这行 提示有错 Uncaught TypeError: Cannot read property 'dom' of null 求组织给看下,刚接触extjs 搞了好几天了总是不显示。。
extjs 4.2 点击事件tab 时 不能显示grid 的问题
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- wangxiao71892 2015-06-30 04:50关注
<br> Ext.onReady(function () {<br> var tab=Ext.createWidget('tabpanel', {<br> renderTo: "divb",<br> activeTab: 0, //指定默认的活动tab 1表示第二个tab是默认激活的<br> width: 600,<br> height: 550,<br> plain: true, //True表示tab候选栏上没有背景图片(默认为false)<br> enableTabScroll: true, //选项卡过多时,允许滚动<br> defaults: { autoScroll: true },<br> items: [{<br> id: "tab1",<br> title: '普通Tab',<br> html: "这只是一个非常普通的Tab。",<br> items:[{xtype:'button',text:'按钮'}],<br> closable: true //这个tab可以被关闭<br> }, {<br> id: "tab4",<br> title: '事件Tab',<br> closable:true,<br> items:[grid]<br> // listeners: { activate: function(){<br> // tab.add(grid);<br> // tab.doLayout();<br> // tab.setActiveTab(aa);<br> // } }<br> }]<br> });</p> <pre><code> Ext.create('Ext.data.Store', { storeId: 'simpsonsStore', fields: ['name', 'email', 'phone'], data: { 'items': [{ 'name': 'Lisa', "email": "lisa@simpsons.com", "phone": "555-111-1224" }, { 'name': 'Bart', "email": "bart@simpsons.com", "phone": "555-222-1234" }, { 'name': 'Homer', "email": "home@simpsons.com", "phone": "555-222-1244" }, { 'name': 'Marge', "email": "marge@simpsons.com", "phone": "555-222-1254" }] }, proxy: { type: 'memory', reader: { type: 'json', root: 'items' } } }); var cm=[{ text: 'Name', dataIndex: 'name' }, { text: 'Email', dataIndex: 'email', flex: 1 }, { text: 'Phone', dataIndex: 'phone' }]; var grid= Ext.create('Ext.grid.GridPanel', { loadMask: true, title: 'Simpsons', id:'aa', store: Ext.data.StoreManager.lookup('simpsonsStore'), colModel:cm, height: 200, width: 500, tbar: [{ //这里开始 xtype: 'toolbar', dock: 'top', items: [{ xtype: 'textfield', id: 'gid', name: 'findstr', maxLength: 10, labelWidth: 35, width: 120, fieldLabel: 'Name' }, { xtype: 'textfield', id: 'gname', name: 'findstr', maxLength: 10, labelWidth: 35, fieldLabel: 'Phone' }] }, { xtype: 'toolbar', dock: 'top', items: ['->', { xtype: 'button', text: '查询', handler: function () { } }, { xtype: 'button', text: '重置', handler: function () { } }] }], renderTo:'tab4' }); }); </script>![图片说明](https://img-ask.csdn.net/upload/201506/30/1435639817_188867.jpg) </code></pre>
解决 无用评论 打赏 举报
悬赏问题
- ¥15 oracle集群安装出bug
- ¥15 关于#python#的问题:自动化测试
- ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
- ¥15 教务系统账号被盗号如何追溯设备
- ¥20 delta降尺度方法,未来数据怎么降尺度
- ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
- ¥15 再不同版本的系统上,TCP传输速度不一致
- ¥15 高德地图2.0 版本点聚合中Marker的位置无法实时更新,如何解决呢?
- ¥15 DIFY API Endpoint 问题。
- ¥20 sub地址DHCP问题