1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    1
    Vote Rating
    0
    ckogler is on a distinguished road

      0  

    Default Ext.grid.EditorGridPanel + checkboxes + drag and drop

    Ext.grid.EditorGridPanel + checkboxes + drag and drop


    Hi,
    i have a Ext.grid.EditorGridPanel which contains some columns and also colums with checkboxes. Now i want do enable drag and drop functionality for single rows. The drag and drop functionality works, but as soon as i enable the "enableDragDrop" functionality in my EditorGridPanel my checkboxes aren't working any more. They show up, but when i click on them, they don't change the value. I would really appreciate any help.

    A sample CheckBox:
    Code:
    var showInGridViewColumn = new Ext.grid.CheckColumn({
                header: t("dataLoggerColumnDefinitionShowInGridView"),
                dataIndex: "showInGridView",
                width: 50
            });
    And this is how my EditorGridPanel looks like:
    Code:
    this.grid = new Ext.grid.EditorGridPanel({
                frame: false,
                enableDragDrop: true,
                ddGroup:'columnDefinitionDragAndDrop',
                autoScroll: true,
                store: this.store,
                columns : typesColumns,
                selModel: new Ext.grid.RowSelectionModel({singleSelect:true}),
                trackMouseOver: true,
                columnLines: true,
                plugins: [showInGridViewColumn,hideInGridViewColumn,showInExport],
                stripeRows: true,
                tbar: [
                    {
                        text: t('add'),
                        handler: this.onAdd.bind(this),
                        iconCls: "pimcore_icon_add"
                    },
                    "->",
                    {
                        text: t('dataLoggerColumnDefinitionWarning'),
                        iconCls: "dataLoggerColumnDefinitionWarning",
                        xtype: "tbtext"
                    }
                ],
                viewConfig: {
                    forceFit: true
                },
                listeners: {
                    'render': {
                        scope: this,
                        fn: function(grid) {
                            var ddrow = new Ext.dd.DropTarget(grid.container, {
                                ddGroup : 'columnDefinitionDragAndDrop',
                                copy:false,
                                notifyDrop : function(dd, e, data){
                                    var ds = grid.store;
                                    var sm = grid.getSelectionModel();
                                    var rows = sm.getSelections();
                                    if(dd.getDragData(e)) {
                                        var cindex=dd.getDragData(e).rowIndex;
                                        if(typeof(cindex) != "undefined") {
                                            for(i = 0; i <  rows.length; i++) {
                                                ds.remove(ds.getById(rows[i].id));
                                            }
                                            ds.insert(cindex,data.selections);
                                            sm.clearSelections();
                                        }
                                    }
                                }
                            });
                        }
                    }
                }
            });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,652
    Vote Rating
    901
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Sounding like the drag and drop is capturing the mousedown event on you.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1