Coolite.AjaxMethod.request使用备忘

由于在网上没有找到Coolite.AjaxMethod.request的详细资料和API,特记录如下:

 

直接调用时cleanRequest : true必不可少


 

 

//Source Project/Coolite.Ext.Web/Core/AjaxMethod.cs之public class AjaxMethodAttribute : Attribute

 

    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class AjaxMethodAttribute : Attribute
    {
        private string failureFn;
        private HttpMethod method = HttpMethod.POST;
        private ClientProxy proxyCreation;
        private string successFn;
        private AjaxEventType type = AjaxEventType.Submit;
        private string msg;
        private string msgCls;
        private MaskTarget target = MaskTarget.Page;
        private string customTarget;
        private bool showMask;
        private ViewStateMode viewStateMode = ViewStateMode.Default;
        private string ajaxMethodNamespace;
        private int timeout = 30000;

 

//Source Project/Coolite.Ext.Web/Events/AjaxEvents/BaseAjaxEvent.cs之public class EventMask : LoadMask

 

// @source core/form/AjaxMethod.js

 

        var obj = {
            name              : options.cleanRequest ? undefined : (options.name || name),
            cleanRequest      : options.cleanRequest,
            url               : options.url,
            control           : Ext.isEmpty(options.control) ? null : { id : options.control },
            eventType         : options.specifier || "public",
            type              : options.type || "submit",
            method            : options.method || "POST",
            eventMask         : options.eventMask,
            extraParams       : options.params,
            ajaxMethodSuccess : options.success,
            ajaxMethodFailure : options.failure,
            viewStateMode     : options.viewStateMode,
            userSuccess       : function (response, result, control, eventType, action, extraParams, o) {
                if (!Ext.isEmpty(o.ajaxMethodSuccess)) {
                    result = Ext.isEmpty(result.result, true) ? (result.d || result) : result.result;
                    o.ajaxMethodSuccess(result, response, extraParams, o);
                }
            },
            userFailure       : function (response, result, control, eventType, action, extraParams, o) {
                if (!Ext.isEmpty(o.ajaxMethodFailure)) {
                    o.ajaxMethodFailure(result.errorMessage, response, extraParams, o);
                }
            }
        };

 

    public enum MaskTarget
    {
        This,
        Parent,
        Page,
        CustomTarget
    }

 

        private MaskTarget target = MaskTarget.Page;
        private string customTarget;

从上面可以看到MaskTarget与customTarget的区别

 

完整文章等源码第二部分提交后再详细写。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值