GridPanel renderTo 问题

greatmind829 2011-01-17 09:50:38
有一个页面 引入了一段JS 。
页面:***.jsp

Ext.onReady(function(){

})

<div id="publicDiv"></div>

js:**.js

var grid = new Ext.grid.GridPanel({
store: store,
renderTo:'publicDiv', // 指向的时候报H IS NULL 这是为什么。。
columns: [
{id:'company',header: "Company", width: 160, sortable: true, dataIndex: 'company'},
{header: "Price", width: 75, sortable: true, renderer: 'usMoney', dataIndex: 'price'},
{header: "Change", width: 75, sortable: true, renderer: change, dataIndex: 'change'},
{header: "% Change", width: 75, sortable: true, renderer: pctChange, dataIndex: 'pctChange'},
{header: "Last Updated", width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
],
stripeRows: true,
autoExpandColumn: 'company',
height:350,
width:600,
title:'Array Grid'

});



望解答。 谢谢了。。
...全文
136 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
greatmind829 2011-01-25
  • 打赏
  • 举报
回复
在一个JS 中用rendetTo 渲染一个层的ID ,得在JS 通过继承才能调用,谢谢大家的解答。
sunliao_first 2011-01-21
  • 打赏
  • 举报
回复
用firebug调试下看看
leehuat 2011-01-19
  • 打赏
  • 举报
回复

js没有引用到?还是什么
kc8886 2011-01-17
  • 打赏
  • 举报
回复
代码方面应该没什么问题
你是这样写的吗?

Ext.onReady(function(){
var grid = new Ext.grid.GridPanel({
store: store,
renderTo:'publicDiv',
columns: [
{id:'company',header: "Company", width: 160, sortable: true, dataIndex: 'company'},
{header: "Price", width: 75, sortable: true, renderer: 'usMoney', dataIndex: 'price'},
{header: "Change", width: 75, sortable: true, renderer: change, dataIndex: 'change'},
{header: "% Change", width: 75, sortable: true, renderer: pctChange, dataIndex: 'pctChange'},
{header: "Last Updated", width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
],
stripeRows: true,
autoExpandColumn: 'company',
height:350,
width:600,
title:'Array Grid'

});


})




licip 2011-01-17
  • 打赏
  • 举报
回复
要看你提供的数据store对不对了。

52,792

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧