Hide Mask during Direct Method Call

  1. #1

    Hide Mask during Direct Method Call

    Hello,

    Whenever i am making a Direct mtehod call, Loading.. message is howing up. I do not want to display this message. I am making the direct method call like this:
    Ext.net.DirectMethods.OnRowExpand(param1, param2, param3);

    and i want to acheive some-thing like
    Ext.net.DirectMethods.OnRowExpand({eventMask: {showMask:false}}, param1, param2, param3)....but it is not working.

    My goal is to hide the masking on the Direct method call. Kindly help me with this.
  2. #2
    Please try the following and let me know if you need further assistance

    Note: try to switch showMask at line 20 :)

    <!DOCTYPE html>
    <html>
    <head runat="server">
        <script type="text/javascript">
            var BeforeAjaxRequest = function (o) {
                var eventMask = o.eventMask || {};
    
                if (eventMask.showMask == null || eventMask.showMask === true) {
                    eventMask.showMask = true;
                    eventMask.customTarget = eventMask.customTarget;
                    o.eventMask = eventMask;
                }
            };
    
            var Click = function (elementToMask) {
                Ext.net.DirectMethod.request({
                    url: Ext.net.ResourceMgr.resolveUrl("~/Example/Test"),
                    cleanRequest: true,
                    eventMask: {
                        showMask: false
                    },
                    success: function (response) {
                        console.log('success');
                    },
                    failure: function (response) {
                        console.log('failure');
                    }
                });
            }
        </script>
    </head>
    <body>
        <ext:ResourceManager ScriptMode="Debug" Theme="Crisp" runat="server">
            <Listeners>
                <BeforeAjaxRequest Handler="BeforeAjaxRequest(o);" />
            </Listeners>
        </ext:ResourceManager>
        <ext:Button Text="Click Me" runat="server">
            <Listeners>
                <Click Handler="Click();" />
            </Listeners>
        </ext:Button>
    </body>
    </html>
    
    namespace SandBox.Controllers
    {
        public class ExampleController : System.Web.Mvc.Controller
        {
            public ActionResult Index() => View();
    
            public ActionResult Test()
            {
                Thread.Sleep(TimeSpan.FromSeconds(5));
    
                return new AjaxResult
                {
                    Success = true
                };
            }
        }
    }
    Last edited by RaphaelSaldanha; May 04, 2016 at 2:42 PM.

Similar Threads

  1. [CLOSED] Authorize, redirect, Direct method call
    By registrator in forum 2.x Legacy Premium Help
    Replies: 11
    Last Post: Feb 19, 2015, 2:39 PM
  2. Replies: 0
    Last Post: May 28, 2013, 2:51 PM
  3. [CLOSED] Direct Event/Method Call Priority
    By bayoglu in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Feb 08, 2013, 2:04 PM
  4. [CLOSED] how to call direct method
    By tactime10 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 04, 2012, 8:38 AM
  5. how to call direct method in asp.net mvc3
    By waqasde in forum 2.x Help
    Replies: 1
    Last Post: Mar 16, 2012, 9:26 AM

Tags for this Thread

Posting Permissions