急。这个form窗口第二次打开就无法关闭
extjs吧
全部回复
仅看楼主
level 1
悠い哉 楼主
var updateForm = Ext.create('Ext.form.Panel', {
id :"updateForm",
title: '查看详情',
bodyPadding: 5,
width: 350,
layout: 'anchor',
defaults: {
anchor: '100%'
},
// The fields
defaultType: 'textfield',
items: [{
id:"ORG_NAME",
fieldLabel: '部门名称',
name: 'ORG_NAME',
allowBlank: true,
width : 50
},{
id:"PARENT_ORG_ID",
fieldLabel: '上级部门',
name: 'PARENT_ORG_ID',
allowBlank: false
},{
id:"ORG_CODE",
fieldLabel:'组织机构编码',
name :'ORG_CODE',
allowBlank: false
} ],
buttons: [{
text: '重置',
handler: function() {
this.up('form').getForm().reset();
}
}, {
text: '确定',
// formBind: true, //only enabled once the form is valid
disabled: false,
handler: function() {
var form = this.up('form').getForm();
if (form.isValid()) {
var formValues=myform.getForm().getValues(); //获取表单中的所有Name键/值对对象
// console.log(formValues);
var inParam = {};
inParam.method = "addOrg";
inParam.STATE = "A";
inParam.ORG_NAME = formValues.ORG_NAME;
// inParam.AREA_ID = areaID;
inParam.ORG_CODE = formValues.ORG_CODE;
inParam.PARENT_ORG_ID=formValues.PARENT_ORG_ID;
// inParam.JOB_ID_LIST = orgJobList;
//inParam.LEADER = leaderID;
var result = callRemoteFunction("StaffOrgService", inParam);
}
}
}]
});
function editInit(obj){
var updateWin = updateWin?updateWin:
Ext.create('Ext.window.Window', {
id:"updateWin",
closeAction: 'close',
constrain: true,
plain: true,
modal: true,
width: 600,
height: 400,
layout: 'fit',
animCollapse : true,
constrain : true,
animateTarget : Ext.getBody(),
items:[updateForm]
});
//判断有没有记录被选中.
var s = Ext.getCmp("gridPanel").getSelectionModel().selected.items;
console.log(s);
console.log(s[0].raw);
if(s.length>0){
Ext.getCmp('ORG_CODE').setValue("4");
Ext.getCmp('ORG_CODE').setValue("4");
updateWin.show();
}else{
alert("请先选择一条信息");
}
2014年07月06日 09点07分 1
1