[CLOSED] Listeners Mask

  1. #1

    [CLOSED] Listeners Mask

    Hello everyone,

    I am going through a grid on client click and changing every cell's value on client side. It takes time.

    Is there any way to show a mask on that event?

    Thank you.

    The script:

    <ext:Button runat="server" Text="Text">
                                    <Listeners>
                                        <Click Handler="selectAll();" />
                                    </Listeners>
                                </ext:Button>
    <ext:XScript ID="XScript1" runat="server">
    
    <script>
    
            function selectAll() {
                    
                    var grid = #{myGrid},
                    columns = grid.columns;
    
                    var store = grid.getStore();
    
                    Ext.each(columns, function(column, j) {
                        store.each(function(record) {
                            record.set(column.text, true);
                        });
                    });
                }
    </script>
        
    </ext:XScript>
    Last edited by Daniil; May 06, 2014 at 6:59 AM. Reason: [CLOSED]
  2. #2
    Hi @rbtceo,

    Masking doesn't make perfect sense for client side operations.

    I have another suggestion - improving the performance of what you are doing.

    Please try the following:
    function selectAll() {
        var grid = #{myGrid},
            columns = grid.columns,
            store = grid.getStore();
     
        Ext.suspendLayouts();
        Ext.each(columns, function(column, j) {
            store.each(function(record) {
                record.set(column.dataIndex, true);
            });
        });
        Ext.resumeLayouts(true);
    }
    or
    function selectAll() {
        var grid = #{myGrid},
            columns = grid.columns,
            store = grid.getStore();
     
        Ext.each(columns, function(column, j) {
            store.each(function(record) {
                record.data[column.dataIndex] = true;
            });
        });
        
        grid.getView().refresh();
    }
  3. #3
    It works visibly faster.
    Thank you.

    But it still takes 2 or 3 seconds.
    From the client view - "it is freezing" for 2-3 seconds.

    It means I still need a mask or something for that time.
  4. #4
    You can try with
    Ext.net.Mask.show({ el: #{myGrid}.view.el });
    and
    Ext.net.Mask.hide();
  5. #5
    Hello Daniil,

    The mask doesn't appear.
    I am using Master page and content pages.
    Ext.Net 2.5.0
    Last edited by geoffrey.mcgill; May 06, 2014 at 3:00 AM.
  6. #6
    The code provide by @daniil works correctly for the scenario you described originally.

    If you cannot provide an adequate sample demonstrating how to reproduce the problem, then we are unable to provide any further assistance.

    Please review the following Guidelines before posting in the forums again.

    http://forums.ext.net/showthread.php...ing-New-Topics

    http://forums.ext.net/showthread.php...ation-Required
    Geoffrey McGill
    Founder & CEO
  7. #7
    Agree.

    The mask is fine.
    Something is wrong in my code.

    The thread can marked as closed.

    Thank you.

Similar Threads

  1. LockingGridView Listeners
    By yash.kapoor in forum 2.x Help
    Replies: 4
    Last Post: Dec 24, 2012, 4:08 AM
  2. Listeners with MVC3
    By zhdl in forum 2.x Help
    Replies: 0
    Last Post: Jul 09, 2012, 2:43 AM
  3. Why Listeners are not themable ?
    By reverseblade in forum 1.x Help
    Replies: 1
    Last Post: Jul 13, 2010, 5:27 AM
  4. How to add event mask for listeners
    By rasu_13 in forum 1.x Help
    Replies: 0
    Last Post: Mar 31, 2010, 4:16 AM
  5. Mutiple listeners
    By vali1993 in forum 1.x Help
    Replies: 0
    Last Post: Mar 16, 2010, 1:17 PM

Tags for this Thread

Posting Permissions