Results 1 to 2 of 2

Thread: [4.1.3] Selection model selectAll suppressEvent doesn't suppress selectionchange

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    1,017
    Vote Rating
    125
      0  

    Default [4.1.3] Selection model selectAll suppressEvent doesn't suppress selectionchange

    REQUIRED INFORMATION

    Ext version tested:
    • Ext 4.1.3

    Browser versions tested against:
    • Chrome
    • IE9

    DOCTYPE tested against:
    • <!DOCTYPE html>

    Description:
    • The selection model's selectAll and deselectAll methods' suppressEvent option doesn't suppress the selectionchange event. I would expect it to be suppressed according the "True to suppress any select events" phrase in the docs. Or do you not consider the selectionchange event to meet the "any select (and deselect) events"?
    • Please note that the selectionchange event fires just once if the suppressEvent option is true, but without that option it fires for each row.
    • Here is a related thread with a possible fix.

    http://www.sencha.com/forum/showthread.php?136629
    • Also a selectAll call selects the last row. It looks buggy.

    Steps to reproduce the problem:
    • Click the "Select all" button
    • Click the "Deselect all" button

    The result that was expected:
    • The selectionchange event does not fire
    • No selection after clicking the "Select all" button

    The result that occurs instead:
    • The selectionchange event does fire
    • The last row is selected after clicking the "Select all" button

    Test Case:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
        <title>selectAll suppressEvent</title>
    
        <link type="text/css" rel="stylesheet" href="../resources/css/ext-all.css" />
        
        <script type="text/javascript" src="../ext-all-debug.js"></script>
    
        <script type="text/javascript">
            Ext.onReady(function () {
                var grid = Ext.create("Ext.grid.Panel", {
                    renderTo: Ext.getBody(),
                    store: {
                        autoLoad: true,
                        fields: [{
                            name: "test"
                        }],
                        proxy: {
                            type: "memory",
                            data: [
                                ["test1"],
                                ["test2"],
                                ["test3"]
                            ],
                            reader: {
                                type: "array"
                            }
                        }
                    },                
                    columns: {
                        items: [{
                            dataIndex: "test",
                            text: "Test"
                        }]
                    },
                    selModel: sm = Ext.create("Ext.selection.RowModel", {
                        selType: "rowmodel",
                        listeners: {
                            selectionchange: {
                                fn: function () {
                                    console.log('selectionchange');
                                }
                            }
                        }
                    })
                });
    
                Ext.create("Ext.button.Button", {
                    renderTo: Ext.getBody(),
                    handler: function () {
                        sm.selectAll(true);
                    },
                    text: "Select all"
                });
    
                Ext.create("Ext.button.Button", {
                    renderTo: Ext.getBody(),
                    handler: function () {
                        sm.deselectAll(true);
                    },
                    text: "Deselect all"
                });
            });
        </script>
    </head>
    <body>
    
    </body>
    </html>
    Object.NET
    Frameworks and Tools for .NET Developers
    --------------------------------------------------
    Ext.NET - Ext JS for ASP.NET - Examples | Twitter
    Bridge.NET - Write C#. Run JavaScript! - Live | Twitter
    --------------------------------------------------

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •