Results 1 to 7 of 7

Thread: Problem with grid using gridviewdragdrop and checkboxmodel

    You found a bug! We've classified it as EXTJS-4878 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium User fabio.policeno's Avatar
    Join Date
    Sep 2010
    Posts
    357
    Vote Rating
    5
      0  

    Default Problem with grid using gridviewdragdrop and checkboxmodel

    Ext version tested:
    • Ext JS 4.0.7

    Browser versions tested against:

    • IE 9
    • FF 8.0.1
    • Chrome 16.0

    Description:
    • Can not deselect the checkbox of row.

    Steps to reproduce the problem:
    • check and uncheck row of grid

    The result that was expected:
    • check and uncheck row of grid

    The result that occurs instead:
    • check the row, but impossible uncheck

    Test Case:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
        <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
        <script type="text/javascript" src="../../ext-all-debug.js"></script>
    </head>
    <body>
        <script type="text/javascript">
        var store = Ext.create('Ext.data.Store', {
            fields:['name', 'email'],
            data:{
                items:[{ 
                    name: 'Lisa',  
                    email: 'lisa@simpsons.com'
                },{ 
                    name: 'Bart',  
                    email: 'bart@simpsons.com'
                },{ 
                    name: 'Homer', 
                    email: 'home@simpsons.com'
                },{ 
                    name: 'Marge', 
                    email: 'marge@simpsons.com'
                }]
            },
            proxy: {
                type: 'memory',
                reader: {
                    type: 'json',
                    root: 'items'
                }
            }
        });
        
        Ext.define('MyGrid', {
            extend: 'Ext.grid.Panel',
            alias: 'widget.mygrid',
            selType: 'checkboxmodel',
            selModel: {mode: 'MULTI'},
            store: store,
            flex: 1,
            columns: [{ 
                header: 'Name',  
                dataIndex: 'name' 
            },{ 
                header: 'Email', 
                dataIndex: 'email'
            }]
        })
        
        Ext.create('Ext.panel.Panel', {
            renderTo: Ext.getBody(),
            layout: 'hbox',
            items:[{
                xtype: 'mygrid',
                viewConfig: {
                    plugins: {
                        ptype: 'gridviewdragdrop',
                        dragGroup: 'listleft',
                        dropGroup: 'listright'
                    }
                }
            },{
                xtype: 'mygrid',
                viewConfig: {
                    plugins: {
                        ptype: 'gridviewdragdrop',
                        dragGroup: 'listright',
                        dropGroup: 'listleft'
                    }
                }
            }]
        });
        </script>
    </body>
    </html>
    Possible Fix:
    http://www.sencha.com/forum/showthre...grid-dragdrop&

    Operating System:
    • Win 7

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

    Default

    This seems to be present in 4.1.0 beta 1 also
    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

  3. #3
    Sencha Premium User fabio.policeno's Avatar
    Join Date
    Sep 2010
    Posts
    357
    Vote Rating
    5
      0  

    Default

    Yes, in version 4.1 beta 1 the error persists

  4. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default

    No need for checkbox selection, simple multi selection is affected also. E.g. if I have multi selection on a non-dnd grid, and click one of the selected rows, all other selected rows deselect. With dnd grid nothing happens. Not a big deal, but it bugs me when I have dnd and non-dnd grids in an application, and behavior is inconsistent.

  5. #5
    Sencha Premium Member
    Join Date
    Nov 2007
    Location
    Bucharest, Romania
    Posts
    14
    Vote Rating
    0
      0  

    Default

    Still reproducing in 4.1.1 GA, any ETA for fixing this issue?

    Thanks,
    Puiu

  6. #6
    Sencha User
    Join Date
    Jul 2008
    Posts
    3
    Vote Rating
    0
      0  

    Default

    I think the selection model and dd conficted in event handling.but I cannot find a correct place to correct it. At last I modify 'itemmousedown' to 'itemclick' in the selection model's bindComponent mothed. The probelm resolved,though not perfect.

    Ext.override(Ext.selection.RowModel,{


    bindComponent: function(view) {
    var me = this;


    me.views = me.views || [];
    me.views.push(view);
    me.bindStore(view.getStore(), true);


    view.on({
    itemclick: me.onRowMouseDown,
    scope: me
    });


    if (me.enableKeyNav) {
    me.initKeyNav(view);
    }
    }
    })

  7. #7
    Sencha User murrah's Avatar
    Join Date
    Oct 2007
    Location
    Katoomba, Blue Mountains, west of Sydney, Australia
    Posts
    398
    Vote Rating
    15
      0  

    Default

    @hrliuhai88

    Yes, I used the override as described above and it solved the problem for me.

    Thanks!

    Murray

Posting Permissions

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