lghclub 2009-06-19 10:32
浏览 211
已采纳

EXT两个小问题

问题一:

jsonString = "{totalCount:"+this.list.size()+"success:true"+",root:"+jsonArray.toString()+"}";

    var _jsonReader = new Ext.data.JsonReader( {
        root : 'root',
        totalProperty : 'totalCount',
        idProperty : 'id',
        remoteSort : false,
        successProperty : '@success'
    }, [{....................................

url : 'save.html',
method:'post',
[color=red] success: function(form, action){
Ext.Msg.alert('success', action.result.info);
ds.load();
editForm.reset();
editWindow.hide();
},
failure : function(form, action) {
Ext.Msg.alert('修改失败', '添加级别失败!');
}[/color]为什么红色这段代码不能执行

问题二:
//--定义编辑窗体

if(!editWindow)

{

editWindow = new Ext.Window({

el: 'edit_win',

title:'编辑记录',

width: 650,

height: 360,

closable: false,

closeAction: 'hide',

resizable: false,

items: editForm
});

editWindow.show(Ext.get('editDataButton'));

editWindow.items.itemAt(0).getForm().loadRecord(record);

}

editForm = new Ext.FormPanel( {
title: 'title',
frame: true,
width: 300,
labelAlign: 'right',
labelWidth: 60,
defaultType: 'textfield',
defaults: {
width: 200,
allowBlank: false
},
defaultType : 'textfield',
items : [{
id:'ids',

name : 'model.id'
},{
fieldLabel : '名字',
name : 'model.name'
},{
fieldLabel : 'itemName',
name : 'model.itemName'
},{
fieldLabel : 'itemValue',
name : 'model.itemValue'
},new Ext.form.TextArea( {
fieldLabel : 'remark',

name : 'model.remark'
}
)],

buttons : [{
text: '保存',
handler: function() {
if (editForm.form.isValid()) {
editForm.form.doAction('submit',{
url : 'save.html',
method:'post',
success: function(form, action){
Ext.Msg.alert('success', action.result.info);
ds.load();
editForm.reset();
editWindow.hide();
},
failure : function(form, action) {
Ext.Msg.alert('修改失败', '添加级别失败!');
}
});
}
}
},{
text : '取消',
handler : function() {
editWindow.hide();
}}
]

    }); 

[color=red]选择一行,点击修改,第一次可以弹出editWindow窗口,第二次点击就不能弹出该窗口,只有再刷新页面才能点击修改弹出窗口,我想不刷新出能弹出该窗口,怎样实现[/color]

  • 写回答

5条回答 默认 最新

  • zhoujuan520 2009-06-19 11:53
    关注

    [code="js"] success: function(form, action){
    alert('test');
    /*Ext.Msg.alert('success', action.result.info);
    ds.load();
    editForm.reset();
    editWindow.hide();*/
    },
    failure : function(form, action) {
    alert('test2');
    //Ext.Msg.alert('修改失败', '添加级别失败!'); [/code]

    按道理,怎么着也会进入一个.如果请求成功了就进入success,请求失败就进入failure
    没有执行,只能说你压根就没有执行请求动作

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败