Results 1 to 2 of 2

Thread: [4.2.0] Checkbox selection model should not force Simple mode for checker column

    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,018

    Default [4.2.0] Checkbox selection model should not force Simple mode for checker column

    REQUIRED INFORMATION

    Ext version tested:

    • Ext 4.2.0

    Browser versions tested against:
    • Any

    DOCTYPE tested against:
    • Any

    Description:
    • Currently, a Checkbox selection model forces Simple mode for the checker column.

    Ext.selection.CheckboxModel processSelection
    Code:
    processSelection: function (view, record, item, index, e) {
        var me = this,
            checker = e.getTarget(me.checkSelector),
            mode;
    
        // checkOnly set, but we didn't click on a checker.
        if (me.checkOnly && !checker) {
            return;
        }
    
        if (checker) {
            mode = me.getSelectionMode();
            // don't change the mode if it's single otherwise
            // we would get multiple selection
            if (mode !== 'SINGLE') {
                me.setSelectionMode('SIMPLE');
            }
            me.selectWithEvent(record, e);
            me.setSelectionMode(mode);
        } else {
            me.selectWithEvent(record, e);
        }
    }
    • Agree, it is convenient to have Simple mode for the checker column, but it should be, at least, configurable. Setting up mode to Multi explicitly I would expect the same clicking on a checkbox or a row.


    Steps to reproduce the problem:
    • Click two rows
    • Click two checkboxes

    The result that was expected:
    • The different result: one selected row VS two ones.

    The result that occurs instead:
    • The same results

    Test Case:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
        <title>Checkbox selection model should not force Simple mode for checker column</title>
    
        <link rel="stylesheet" href="../resources/css/ext-all.css" />
        
        <script src="../ext-all-debug.js"></script>
    
        <script>
            Ext.onReady(function () {
                Ext.create("Ext.grid.Panel", {
                    renderTo: Ext.getBody(),
                    store: {
                        fields: [{
                            name: "test1"    
                        }, {
                            name: "test2"    
                        }, {
                            name: "test3"    
                        }],
                        data: [{
                            test1: "1",
                            test2: "2",
                            test3: "3"
                        },
                        {
                            test1: "4",
                            test2: "5",
                            test3: "6"
                        }, {
                            test1: "7",
                            test2: "8",
                            test3: "9"
                        }]
                    },
                    columns: [{
                        text: "Test1",
                        dataIndex: "test1"
                    }, {
                        text: "Test2",
                        dataIndex: "test2"
                    }, {
                        text: "Test3",
                        dataIndex: "test3"
                    }],
                    selType: "checkboxmodel",
                    selModel: {
                        mode: "MULTI"
                    }
                });
            });
        </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 User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165

    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
  •