[CLOSED] EventMask behaviour

  1. #1

    [CLOSED] EventMask behaviour


    When I use
        <EventMask ShowMask="true" MinDelay="500" Msg="Loading..." />
    The "Loading" message is shown always. I want the following:
    1) If the event last more than 500 ms, then show the "Loading" message
    2) If the event is short than 500 ms then nothing happen (no message, no flicker, nothing)

    It is possible to get this behavior of EventMask? How?

    Regards

  2. #2

    RE: [CLOSED] EventMask behaviour

    This functionality is not currently included with the LoadMask.

    I think you would need a "Delay" property.


    The LoadMask is set at the start of the request and removed at the end. Adding the LoadMask after 500ms would be confusing to the user.


    Geoffrey McGill
    Founder
  3. #3

    RE: [CLOSED] EventMask behaviour

    Hi Pablo,

    You can use the following sample for emulate required functionality
    <%@ Page Language="C#" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
        
        <script type="text/javascript">
            var btnMask = function (btn) {
                var maskWholePage = function(btn){
                    el = Ext.getBody().createChild({ style: "position:absolute;left:0;top:0;width:100%;height:100%;z-index:20000;background-color:Transparent;" });
                    var scroll = Ext.getBody().getScroll();
                    el.setLeftTop(scroll.left, scroll.top);
    
                    el.mask("Saving...", "x-mask-loading");
                    btn.maskEl = el;
                }            
                
                btn.task = new Ext.util.DelayedTask(maskWholePage.createCallback(btn));
                btn.task.delay(500);
            }
            
            var btnUnmask = function(btn){
                btn.task.cancel();
                delete btn.task;
                if(btn.maskEl){
                    btn.maskEl.unmask();
                    delete btn.maskEl;
                }
            }
        </script>
        
        <script runat="server">
            protected void ClickEvent1(object sender, AjaxEventArgs e)
            {
                System.Threading.Thread.Sleep(1000);
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Debug" />
            
            <ext:Button runat="server" Text="Click">
                <AjaxEvents>
                    <Click OnEvent="ClickEvent1" 
                        Before="btnMask(el);" 
                        Success="btnUnmask(el);">
                    </Click>
                </AjaxEvents>        
            </ext:Button>
        </form>
    </body>
    </html>

Similar Threads

  1. [CLOSED] CSS behaviour is different in Local and Live
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 16
    Last Post: Aug 22, 2011, 12:07 PM
  2. [CLOSED] Split Button behaviour
    By JonG in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 17, 2010, 8:49 AM
  3. Strange behaviour in markup
    By Paul D in forum 1.x Help
    Replies: 1
    Last Post: Nov 09, 2010, 12:27 PM
  4. FileUploadField button behaviour
    By Neil_Walters in forum 1.x Help
    Replies: 1
    Last Post: Feb 01, 2010, 10:27 AM
  5. [CLOSED] strange ComboBox behaviour
    By alexp in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 01, 2009, 10:13 AM

Posting Permissions