Results 1 to 2 of 2

Thread: CheckBoxModel and text column interacting in way does not make sense

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Touch Premium Member pkellner's Avatar
    Join Date
    Sep 2008
    Location
    San Jose, California
    Posts
    833
    Vote Rating
    25
      0  

    Default CheckBoxModel and text column interacting in way does not make sense

    In the below example, we have a checkbox column that is in MULTI mode. If you check each row's checkbox individually, it works as expected.

    However, when you click on the "tagName" column, it puts a checkbox in just that row and then, deselects all previously selected checkboxes.

    Code:
    Ext.define('MyApp.view.MyViewport', {
        extend: 'Ext.container.Viewport',
    
    
        id: 'myViewPortId',
    
    
        initComponent: function() {
            var me = this;
    
    
            Ext.applyIf(me, {
                items: [
                    {
                        xtype: 'gridpanel',
                        title: 'My Grid Panel',
                        store: 'MyStore',
                        columns: [
                            {
                                xtype: 'gridcolumn',
                                dataIndex: 'tagName',
                                text: 'TagName'
                            },
                            {
                                xtype: 'gridcolumn',
                                dataIndex: 'tagSelected',
                                text: 'TagSelected'
                            }
                        ],
                        listeners: {
                            afterrender: {
                                fn: me.onGridpanelAfterRender,
                                scope: me
                            }
                        },
                        selModel: Ext.create('Ext.selection.CheckboxModel', {
    
    
                        })
                    }
                ]
            });
    
    
            me.callParent(arguments);
        },
    
    
        onGridpanelAfterRender: function(component, eOpts) {
    
    
            component.getStore().loadData(
            [
            { tagName: 'tag1',tagSelected: true },
            { tagName: 'tag2',tagSelected: false },
            { tagName: 'tag3',tagSelected: true }
            ]
            );
        }
    
    
    });
    
    Ext.define('MyApp.store.MyStore', {
        extend: 'Ext.data.Store',
    
    
        requires: [
            'MyApp.model.MyModel'
        ],
    
    
        constructor: function(cfg) {
            var me = this;
            cfg = cfg || {};
            me.callParent([Ext.apply({
                model: 'MyApp.model.MyModel',
                storeId: 'MyStore',
                proxy: {
                    type: 'memory',
                    data: [
                        {
                            tagName: 'tag1',
                            tagSelected: true
                        },
                        {
                            tagName: 'tag2',
                            tagSelected: false
                        },
                        {
                            tagName: 'tag3',
                            tagSelected: true
                        }
                    ]
                }
            }, cfg)]);
        }
    });

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

    Default

    Quote Originally Posted by pkellner View Post
    However, when you click on the "tagName" column, it puts a checkbox in just that row and then, deselects all previously selected checkboxes.
    That is how it's supposed to work. Clicking on the row outside of the checkbox will only select that one row but if you want to select multiple then you have to use the checkbox.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Posting Permissions

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