• sencha touch JsonP 自动提示消息 masked(废弃 仅参考)


    查看Ext.data.JsonP源码重写了源码中的方法,以便能够加入自动提示。看起来不是那么的优雅,求高人指点

     1         var me = this;
     2         //提示消息
     3         me.message = '正在努力加载中...';
     4         //提示消息组件
     5         var cardPanel = Ext.getCmp('cardPanel');
     6         Ext.data.JsonP.handleResponse = function (result, request) {
     7             var success = true;
     8 
     9             if (request.timeout) {
    10                 clearTimeout(request.timeout);
    11             }
    12 
    13             delete this[request.callbackName];
    14             delete this.requests[request.id];
    15 
    16             this.cleanupErrorHandling(request);
    17             Ext.fly(request.script).destroy();
    18 
    19             if (request.errorType) {
    20                 success = false;
    21                 Ext.callback(request.failure, request.scope, [request.errorType, request]);
    22             } else {
    23                 Ext.callback(request.success, request.scope, [result, request]);
    24             }
    25             Ext.callback(request.callback, request.scope, [success, result, request.errorType, request]);
    26             //隐藏消息提示
    27             cardPanel.hideMessage();
    28         };
    29 
    30         Ext.data.JsonP.createScript = function (url, params, options) {
    31             //显示消息提示
    32             if (me.message) {
    33                 cardPanel.showMessage(me.message, true);
    34             }
    35             var script = document.createElement('script');
    36             script.setAttribute("src", Ext.urlAppend(url, Ext.Object.toQueryString(params)));
    37             script.setAttribute("async", true);
    38             script.setAttribute("type", "text/javascript");
    39             return script;
    40         };
  • 相关阅读:
    第六章 编译并运行程序
    第五章 顺序型编程进阶
    第四章 异常
    第三章 顺序型编程
    TCP和UDP的区别和优缺点
    Java UDP Socket编程
    springboot 学习资源推荐
    springboot集成redis
    微信公众号的SpringBoot+Quartz的定时任务Demo
    远程桌面发生身份验证错误,要求的函数不受支持【WIN10家庭】或【专业版】--解决办法
  • 原文地址:https://www.cnblogs.com/mlzs/p/3124068.html
Copyright © 2020-2023  润新知