修改单元格出现 fireFn 为空或不是对象 (ExtJS2.1)
悬赏:5 发布时间:2008-07-10 提问人:tiaozao (初级程序员)
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>无标题页</title>
<link rel="stylesheet" type="text/css" href="css/ext-all.css" />
<script type="text/javascript" src="js/ext-base.js"></script>
<script type="text/javascript" src="js/ext-all.js"></script>
<script type="text/javascript" src="js/ext-lang-zh_CN.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var data=[{id:1,
name:'小王',
email:'xiaowang@easyjf.com',
sex:'男',
bornDate:'1991-4-4'},
{id:1,
name:'小李',
email:'xiaoli@easyjf.com',
sex:'男',
bornDate:'1992-5-6'},
{id:1,
name:'小兰',
email:'xiaoxiao@easyjf.com',
sex:'女',
bornDate:'1993-3-7'}
]; //数据
var store=new Ext.data.JsonStore({
data:data,
fields:["id","name","sex","email",{name:"bornDate",type:"date",dateFormat:"Y-n-j"}] //转数据
});
var colM=new Ext.grid.ColumnModel([{
header:"姓名",
dataIndex:"name",
sortable:true,
editor:new Ext.form.TextField({allowBlank:false})}, //编辑 TextBox 且设置不能为空
{header:"性别",
dataIndex:"sex",
editor:new Ext.form.ComboBox({transform:"sexList",//显示下拉框 对应Select ID
triggerAction: 'all',
lazyRender:true})
},
{header:"出生日期",
dataIndex:"bornDate",
width:120,
renderer:Ext.util.Format.dateRenderer('Y年m月d日'), //格式化 日期
editor:new Ext.form.DateField({format:'Y年m月d日'})}, //编辑时出现 日期
{header:"电子邮件",
dataIndex:"email",
sortable:true,
editor:new Ext.form.TextField()}
]);
var grid1 = new Ext.grid.EditorGridPanel({ //创建 EditorGridPanel
renderTo:"hello",
title:"学生基本信息管理",
height:200,
width:600,
cm:colM,
store:store,
autoExpandColumn:3,
clicksToEdit:1
});
grid1.on("afteredit",this.afterEdit);
});
afterEdit:function(obj){
}
</script>
</head>
<body>
<form id="form1" runat="server">
<select id="sexList">
<option>男</option>
<option>女</option>
</select>
<div id="hello">
</div>
</form>
</body>
</html>
该问题已经关闭: 超过15天由系统自动关闭,悬赏平分给所有参与回答的会员
<head id="Head1" runat="server">
<title>无标题页</title>
<link rel="stylesheet" type="text/css" href="css/ext-all.css" />
<script type="text/javascript" src="js/ext-base.js"></script>
<script type="text/javascript" src="js/ext-all.js"></script>
<script type="text/javascript" src="js/ext-lang-zh_CN.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var data=[{id:1,
name:'小王',
email:'xiaowang@easyjf.com',
sex:'男',
bornDate:'1991-4-4'},
{id:1,
name:'小李',
email:'xiaoli@easyjf.com',
sex:'男',
bornDate:'1992-5-6'},
{id:1,
name:'小兰',
email:'xiaoxiao@easyjf.com',
sex:'女',
bornDate:'1993-3-7'}
]; //数据
var store=new Ext.data.JsonStore({
data:data,
fields:["id","name","sex","email",{name:"bornDate",type:"date",dateFormat:"Y-n-j"}] //转数据
});
var colM=new Ext.grid.ColumnModel([{
header:"姓名",
dataIndex:"name",
sortable:true,
editor:new Ext.form.TextField({allowBlank:false})}, //编辑 TextBox 且设置不能为空
{header:"性别",
dataIndex:"sex",
editor:new Ext.form.ComboBox({transform:"sexList",//显示下拉框 对应Select ID
triggerAction: 'all',
lazyRender:true})
},
{header:"出生日期",
dataIndex:"bornDate",
width:120,
renderer:Ext.util.Format.dateRenderer('Y年m月d日'), //格式化 日期
editor:new Ext.form.DateField({format:'Y年m月d日'})}, //编辑时出现 日期
{header:"电子邮件",
dataIndex:"email",
sortable:true,
editor:new Ext.form.TextField()}
]);
var grid1 = new Ext.grid.EditorGridPanel({ //创建 EditorGridPanel
renderTo:"hello",
title:"学生基本信息管理",
height:200,
width:600,
cm:colM,
store:store,
autoExpandColumn:3,
clicksToEdit:1
});
grid1.on("afteredit",this.afterEdit);
});
afterEdit:function(obj){
}
</script>
</head>
<body>
<form id="form1" runat="server">
<select id="sexList">
<option>男</option>
<option>女</option>
</select>
<div id="hello">
</div>
</form>
</body>
</html>
该问题已经关闭: 超过15天由系统自动关闭,悬赏平分给所有参与回答的会员




