/*!
* Ext JS Library 3.4.0
* Copyright(c) 2006-2011 Sencha Inc.
* [email protected]
* http://www.sencha.com/license
*/
var form;
var win;
Ext.onReady(function(){ // sample static data for the store
var data = [
[110,'A112',002,'xiaoli','男','9/1 12:00am','1231212121212','汉族','团员','杭电','本科','学士','计算机','007','公证员','1021','135881212','[email protected]','环城西路33号','英语','六级','二级','9/1 12:00am','在职','篮球','跑步','在职','W1111','无职','平民','是','有','CY2323','是','ZX2312','9/1 12:00am','教学','无','是','9/1 12:00am','是','9/1 12:00am','理工','本科','9/1 12:00am','哲学','jklx']
];
// create the data store
var store = new Ext.data.ArrayStore({
fields: [
{name: 'sqm'},
{name: 'rybm', type: 'fit'}
],
data: data
});
// get a form
function getUpdateForm(){
form = new Ext.form.FormPanel({
width: 500,
height: 300,
// title: 'User Details',
defaultType: 'textfield',
closeAction:'hide',
autoDestroy :false,
padding: 10,
autoScroll:true,
labelWidth: 90,
tabr:[{
text:'确定'
},{
text:'取消'
}],
items:[{
fieldLabel: '授权码',
name : 'sqm',
id:'sqm'
// allowBlank : false,
// anchor:'100%' // anchor width by percentage
},{
fieldLabel: '机构编码',
name : 'rybm',
allowBlank : false,
id:'rybm'
// anchor:'100%' // anchor width by percentage
}]
});
return form;
}
// create the Grid
// To use locking functionality we must explicitly specify the LockingColumnModel and the LockingGridView
var grid = new Ext.grid.GridPanel({
store: store,
title:'人员信息表',
tbar:[{
text:'新增',
id:'addNewOne',
iconCls: 'add16',
onClick:function(){
//alert('gg');
if(!form){
form=getUpdateForm();
}
if(!win){
var win = new Ext.Window({
title:'新增',
closeAction:'hide',
width:550,
height:330,
layout:'fit',
plain:true,
tbar:[{
text:'保存',
iconCls: 'add16',
onClick:function(){
alert('saved');
}
},{
text:'取消',
iconCls: 'add16',
onClick:function(){
alert('未保存');
}
}],
items:form
});
}
win.show();
}
},{
text:'删除',
id:'deleteOneChoosed',
iconCls: 'add16'
},{
text:'修改',
id:'updateOneChoosed',
iconCls: 'add16',
onClick:function(){
alert('gg');
if(win&&form){
win.Window(form);
}else{
form = getUpdateForm();
win = new Ext.Window({
title:'修改',
closeAction:'hide',
width:550,
height:330,
layout:'fit',
plain:true,
items:form,
rendered: true
});
win.show();
}
}
}],
colModel: new Ext.ux.grid.LockingColumnModel([
{header: '授权码', width: 85, sortable: true, dataIndex: 'sqm', id:'sqm'},
{header: '人员编码', width: 85, sortable: true, renderer: 'rybm', dataIndex: 'rybm'}
]),
stripeRows: true,
height: 300,
width: 1200,
listeners:{
//双击事件
rowdblclick : function(grid,row){
var record = grid.store.getAt(row);
//alert(record.get('sqm')+record.get('rybm')); var ct = new Ext.form.FormPanel({
width: 500,
height: 300,
// title: 'User Details',
defaultType: 'textfield',
padding: 10,
autoScroll:true,
labelWidth: 90,
tbar: [{
text: '新增',
id:'addNewOne',
iconCls: 'add16',
onClick:function(){
//form = ct.getForm().reset();
// ct.getForm().hide();
form=getUpdateForm();
win.close();
//win.setItems('form');
win=new Ext.Window({
title:'新增人员',
layout:'fit',
width:700,
height:400,
plain:true,
bodyStyle:'padding:5px;',
buttonAlign:'center',
items:form,
tbar:[{
text:'保存',
id:'sured',
iconCls:'add16',
onClick:function(){
alert('保存成功');
}
},{
text:'取消',
id:'canel',
iconCls:'add16',
onClick:function(){
alert('已经取消');
}
}]
});
win.show();
}
//onClick:'getUpdateForm()'
},{
text: '修改',
id:'update',
iconCls: 'add16',
onClick:function(){
alert('修改');
}
},{
text: '保存',
id:'save',
iconCls: 'add16',
onClick:function(){
alert('保存成功');
}
}],
items: [{
fieldLabel: '授权码',
value:record.get('sqm')
}, {
fieldLabel: '人员编码',
value:record.get('rybm')
}]
});
var win = new Ext.Window({
title:'人员信息',
layout:'fit',
width:700,
height:400,
plain:true,
bodyStyle:'padding:5px;',
buttonAlign:'center',
items:ct,
});
win.show();
}
},
// title: '人员信息表',
//view: new Ext.ux.grid.LockingGridView()
});
// render the grid to the specified div in the page
grid.render('grid-ryxx');
});
为什么我双击一行出来后,点新增,出来的没有文本框的?关掉人员信息窗口,点人员信息表的新增按钮的时候没有用了,报错TypeError: this.dom is undefined 是不是两个不兼容??extjs
* Ext JS Library 3.4.0
* Copyright(c) 2006-2011 Sencha Inc.
* [email protected]
* http://www.sencha.com/license
*/
var form;
var win;
Ext.onReady(function(){ // sample static data for the store
var data = [
[110,'A112',002,'xiaoli','男','9/1 12:00am','1231212121212','汉族','团员','杭电','本科','学士','计算机','007','公证员','1021','135881212','[email protected]','环城西路33号','英语','六级','二级','9/1 12:00am','在职','篮球','跑步','在职','W1111','无职','平民','是','有','CY2323','是','ZX2312','9/1 12:00am','教学','无','是','9/1 12:00am','是','9/1 12:00am','理工','本科','9/1 12:00am','哲学','jklx']
];
// create the data store
var store = new Ext.data.ArrayStore({
fields: [
{name: 'sqm'},
{name: 'rybm', type: 'fit'}
],
data: data
});
// get a form
function getUpdateForm(){
form = new Ext.form.FormPanel({
width: 500,
height: 300,
// title: 'User Details',
defaultType: 'textfield',
closeAction:'hide',
autoDestroy :false,
padding: 10,
autoScroll:true,
labelWidth: 90,
tabr:[{
text:'确定'
},{
text:'取消'
}],
items:[{
fieldLabel: '授权码',
name : 'sqm',
id:'sqm'
// allowBlank : false,
// anchor:'100%' // anchor width by percentage
},{
fieldLabel: '机构编码',
name : 'rybm',
allowBlank : false,
id:'rybm'
// anchor:'100%' // anchor width by percentage
}]
});
return form;
}
// create the Grid
// To use locking functionality we must explicitly specify the LockingColumnModel and the LockingGridView
var grid = new Ext.grid.GridPanel({
store: store,
title:'人员信息表',
tbar:[{
text:'新增',
id:'addNewOne',
iconCls: 'add16',
onClick:function(){
//alert('gg');
if(!form){
form=getUpdateForm();
}
if(!win){
var win = new Ext.Window({
title:'新增',
closeAction:'hide',
width:550,
height:330,
layout:'fit',
plain:true,
tbar:[{
text:'保存',
iconCls: 'add16',
onClick:function(){
alert('saved');
}
},{
text:'取消',
iconCls: 'add16',
onClick:function(){
alert('未保存');
}
}],
items:form
});
}
win.show();
}
},{
text:'删除',
id:'deleteOneChoosed',
iconCls: 'add16'
},{
text:'修改',
id:'updateOneChoosed',
iconCls: 'add16',
onClick:function(){
alert('gg');
if(win&&form){
win.Window(form);
}else{
form = getUpdateForm();
win = new Ext.Window({
title:'修改',
closeAction:'hide',
width:550,
height:330,
layout:'fit',
plain:true,
items:form,
rendered: true
});
win.show();
}
}
}],
colModel: new Ext.ux.grid.LockingColumnModel([
{header: '授权码', width: 85, sortable: true, dataIndex: 'sqm', id:'sqm'},
{header: '人员编码', width: 85, sortable: true, renderer: 'rybm', dataIndex: 'rybm'}
]),
stripeRows: true,
height: 300,
width: 1200,
listeners:{
//双击事件
rowdblclick : function(grid,row){
var record = grid.store.getAt(row);
//alert(record.get('sqm')+record.get('rybm')); var ct = new Ext.form.FormPanel({
width: 500,
height: 300,
// title: 'User Details',
defaultType: 'textfield',
padding: 10,
autoScroll:true,
labelWidth: 90,
tbar: [{
text: '新增',
id:'addNewOne',
iconCls: 'add16',
onClick:function(){
//form = ct.getForm().reset();
// ct.getForm().hide();
form=getUpdateForm();
win.close();
//win.setItems('form');
win=new Ext.Window({
title:'新增人员',
layout:'fit',
width:700,
height:400,
plain:true,
bodyStyle:'padding:5px;',
buttonAlign:'center',
items:form,
tbar:[{
text:'保存',
id:'sured',
iconCls:'add16',
onClick:function(){
alert('保存成功');
}
},{
text:'取消',
id:'canel',
iconCls:'add16',
onClick:function(){
alert('已经取消');
}
}]
});
win.show();
}
//onClick:'getUpdateForm()'
},{
text: '修改',
id:'update',
iconCls: 'add16',
onClick:function(){
alert('修改');
}
},{
text: '保存',
id:'save',
iconCls: 'add16',
onClick:function(){
alert('保存成功');
}
}],
items: [{
fieldLabel: '授权码',
value:record.get('sqm')
}, {
fieldLabel: '人员编码',
value:record.get('rybm')
}]
});
var win = new Ext.Window({
title:'人员信息',
layout:'fit',
width:700,
height:400,
plain:true,
bodyStyle:'padding:5px;',
buttonAlign:'center',
items:ct,
});
win.show();
}
},
// title: '人员信息表',
//view: new Ext.ux.grid.LockingGridView()
});
// render the grid to the specified div in the page
grid.render('grid-ryxx');
});
为什么我双击一行出来后,点新增,出来的没有文本框的?关掉人员信息窗口,点人员信息表的新增按钮的时候没有用了,报错TypeError: this.dom is undefined 是不是两个不兼容??extjs
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货