缺省设置button不可用,怎样在getlogid()设置button可用?
setT = new Ext.form.FieldSet({
// title:'fieldset',
//width:400,
autoHeight:true,
autoWidth:true,
// columnWidth: 1,
layout: 'column',
border:false,
anchor:'100%',
labelWidth: 60,
items:[{
columnWidth:.2,
layout: 'form',
border:false,
items: [
{
columnWidth:.69,
layout: 'form',
border:false,
items: [{
xtype:'textfield',
fieldLabel: '设备维护保养记录',
name: 'byjl',
value:' 经 查 各 服 务 器 及 网 络 均 正 常',
anchor:'98%'
}]
},{
columnWidth:.3,
layout: 'form',
border:false,
items: [{
xtype: 'lovcombo',
fieldLabel: '值班人员',
name: 'zbryt',
store:whryStore,
/*store: new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:Srvt + '?method=cmbUsername'}),
reader: new Ext.data.ArrayReader({},[
{name:'value'},
{name:'text'}
])
}),*/
mode: 'remote',
triggerAction: 'all',
valueField: 'value',
displayField: 'text',
editable : true,
hiddenName:'zbry',
anchor:'99%'
}]
},{
columnWidth:.3,
layout: 'form',
border:false,
items: [{
xtype:'button',
text:'query',
//disabled:true,
id:"query",
//iconCls: 'calendar',
handler: function(){
},
scope: this
}]
}]
}); setTform = new Ext.form.FormPanel({
height: 90,
border: false,
labelWidth:60,
labelAlign:'right',
frame:true,
autoWidth : true,
autoScroll:true,
// hideBorder:true,
url:Srvt + '?method=insert',
items:[setT]
});
function getLogid(){//setTform的附属函数。根据班次、单位、日期确定本日志是否已填写过。是:调出追加;否:插入本日志
var sbpartid=setTform.getForm().findField('sbpartid').getValue();
var bcid=setTform.getForm().findField('bc').getValue();
var rq=Ext.util.Format.date(setTform.getForm().findField('rq').getValue(),"y-m-d");
Ext.Ajax.request({
url:Srvt + '?method=isLog',
params:{sbpartid:sbpartid,bcid:bcid,rq:rq},
success: function(response, options) {
var responseArray = Ext.util.JSON.decode(response.responseText);
//Ext.Msg.alert('信息', responseArray.list[0].id);
if(responseArray.success == true){
//缺省设置button不可用,怎样在这里设置button可用?
//setTform.getForm().findField('byjl').enable();
//Ext.get('query').dom.disabled=false;
query.disabled=false;
//setTform.getForm().findField('logid').setValue(responseArray.id);
if(responseArray.totalSize==1){//已存在则把相关值赋给表单
mylogid=responseArray.list[0].id;
setTform.getForm().findField('sbry').setValue(responseArray.list[0].sbry);
setTform.getForm().findField('byjl').setValue(responseArray.list[0].byjl);
setTform.getForm().findField('zbry').setValue(responseArray.list[0].zbry);
setTform.getForm().findField('logid').setValue(mylogid);
masGrid.store.load({params:{start:0,limit:pagesize,logid:mylogid}});
} else{
mylogid=responseArray.id;
Ext.MessageBox
.confirm(
'确认',
'确定要填写新日志?',
function(btn) {
if (btn == 'yes') {//填写新日志。设置grid可以使用
Ext.Ajax.request({
url:Srvt + '?method=insert',
params:{sbpartid:sbpartid,bcid:bcid,rq:rq},
success: function(response, options) {
var responseArray = Ext.util.JSON.decode(response.responseText);
if(responseArray.success == true){ //设置grid可以使用
mylogid=responseArray.logid;
setTform.getForm().findField('logid').setValue(mylogid);
masGrid.store.load({params:{start:0,limit:pagesize,logid:mylogid}});
}else{//填写新日志失败。设置grid不可以使用
Ext.Msg.alert('信息', "error");
}
},
failure:function()
{
Ext.Msg.alert( "注册失败!");
}
});
}else{//不填写新日志。设置grid不可以使用
setTform.getForm().findField('logid').setValue("");
setTform.getForm().findField('sbry').setValue("");
setTform.getForm().findField('zbry').setValue("");
masGrid.store.removeAll();
}
});//%$%$%$%$%$%$
}
}else{//用户名可以注册
Ext.Msg.alert('信息', "error");
}
},
failure:function()
{
Ext.Msg.alert( "注册失败!");
}
});
}
setT = new Ext.form.FieldSet({
// title:'fieldset',
//width:400,
autoHeight:true,
autoWidth:true,
// columnWidth: 1,
layout: 'column',
border:false,
anchor:'100%',
labelWidth: 60,
items:[{
columnWidth:.2,
layout: 'form',
border:false,
items: [
{
columnWidth:.69,
layout: 'form',
border:false,
items: [{
xtype:'textfield',
fieldLabel: '设备维护保养记录',
name: 'byjl',
value:' 经 查 各 服 务 器 及 网 络 均 正 常',
anchor:'98%'
}]
},{
columnWidth:.3,
layout: 'form',
border:false,
items: [{
xtype: 'lovcombo',
fieldLabel: '值班人员',
name: 'zbryt',
store:whryStore,
/*store: new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:Srvt + '?method=cmbUsername'}),
reader: new Ext.data.ArrayReader({},[
{name:'value'},
{name:'text'}
])
}),*/
mode: 'remote',
triggerAction: 'all',
valueField: 'value',
displayField: 'text',
editable : true,
hiddenName:'zbry',
anchor:'99%'
}]
},{
columnWidth:.3,
layout: 'form',
border:false,
items: [{
xtype:'button',
text:'query',
//disabled:true,
id:"query",
//iconCls: 'calendar',
handler: function(){
},
scope: this
}]
}]
}); setTform = new Ext.form.FormPanel({
height: 90,
border: false,
labelWidth:60,
labelAlign:'right',
frame:true,
autoWidth : true,
autoScroll:true,
// hideBorder:true,
url:Srvt + '?method=insert',
items:[setT]
});
function getLogid(){//setTform的附属函数。根据班次、单位、日期确定本日志是否已填写过。是:调出追加;否:插入本日志
var sbpartid=setTform.getForm().findField('sbpartid').getValue();
var bcid=setTform.getForm().findField('bc').getValue();
var rq=Ext.util.Format.date(setTform.getForm().findField('rq').getValue(),"y-m-d");
Ext.Ajax.request({
url:Srvt + '?method=isLog',
params:{sbpartid:sbpartid,bcid:bcid,rq:rq},
success: function(response, options) {
var responseArray = Ext.util.JSON.decode(response.responseText);
//Ext.Msg.alert('信息', responseArray.list[0].id);
if(responseArray.success == true){
//缺省设置button不可用,怎样在这里设置button可用?
//setTform.getForm().findField('byjl').enable();
//Ext.get('query').dom.disabled=false;
query.disabled=false;
//setTform.getForm().findField('logid').setValue(responseArray.id);
if(responseArray.totalSize==1){//已存在则把相关值赋给表单
mylogid=responseArray.list[0].id;
setTform.getForm().findField('sbry').setValue(responseArray.list[0].sbry);
setTform.getForm().findField('byjl').setValue(responseArray.list[0].byjl);
setTform.getForm().findField('zbry').setValue(responseArray.list[0].zbry);
setTform.getForm().findField('logid').setValue(mylogid);
masGrid.store.load({params:{start:0,limit:pagesize,logid:mylogid}});
} else{
mylogid=responseArray.id;
Ext.MessageBox
.confirm(
'确认',
'确定要填写新日志?',
function(btn) {
if (btn == 'yes') {//填写新日志。设置grid可以使用
Ext.Ajax.request({
url:Srvt + '?method=insert',
params:{sbpartid:sbpartid,bcid:bcid,rq:rq},
success: function(response, options) {
var responseArray = Ext.util.JSON.decode(response.responseText);
if(responseArray.success == true){ //设置grid可以使用
mylogid=responseArray.logid;
setTform.getForm().findField('logid').setValue(mylogid);
masGrid.store.load({params:{start:0,limit:pagesize,logid:mylogid}});
}else{//填写新日志失败。设置grid不可以使用
Ext.Msg.alert('信息', "error");
}
},
failure:function()
{
Ext.Msg.alert( "注册失败!");
}
});
}else{//不填写新日志。设置grid不可以使用
setTform.getForm().findField('logid').setValue("");
setTform.getForm().findField('sbry').setValue("");
setTform.getForm().findField('zbry').setValue("");
masGrid.store.removeAll();
}
});//%$%$%$%$%$%$
}
}else{//用户名可以注册
Ext.Msg.alert('信息', "error");
}
},
failure:function()
{
Ext.Msg.alert( "注册失败!");
}
});
}
解决方案 »
- <A href="javascript:void(0)">什么意思?
- hookee在看一下刚才那个ext.combobox载入数据问题
- window.open的fullscreen问题,在线等
- 我的一个框架页中的子页内嵌一个YAHOO的静态页,怎么取得YAHOO的这个页的URL和标题
- 关于用JAVASCRIPT调用后台方法
- 为了debug我需要把一些参数显示在page上,请问应该怎样做?
- 那有下载scriptx.cab控件的地址,谢谢帮忙!!
- 碰到一个简单又恶心问题。XD们帮看一下,该如何解决。
- 请大家帮忙:javascript编码问题
- 请教!我想要在一个页面中引用iframe中的某一对象,希望高手指点,立马给分?
- 哪位帮忙增加点功能。。。。。
- 如何取出combox的缓存?
document.getElementById("BUTTON的id").disabled=false;
}