日期:2014-05-16  浏览次数:20430 次

ExtJs使用心得
ExtJs使用心得

   1. 关于Ext.Ajax.request

    Ext.Ajax.request可以通过定义success和failure属性来判断是否成功,并取出返回值,获取返回值的方法如下:(此方法 Ext.data.HttpProxy同样有效)

    *     先定义success和failure属性
    *     通过Ext.util.JSON.decode(response.responseText)来获取Json格式的数据


Ext.Ajax.request
Ext.Ajax.request({
                        url : 'url',
                        params : {
                            ID : record.data.ID
                        },
                        success : function(response, options) {
                            var txt=Ext.util.JSON.decode(response.responseText);
                           
                            if(txt.success)
                            {
                                Ext.Msg.show({
                                    title : '成功提示',
                                    msg : '删除成功!',
                                    buttons : Ext.Msg.OK,
                                    icon: Ext.MessageBox.INFO
                                });
                                Project_grid.getStore().remove(record);
                            }
                            else
         &