-
9 Feb 2011 3:03 AM #1
[3.3.0] Ext.grid.GridPanel -> enableDragDrop : true & CheckboxSelectionModel
[3.3.0] Ext.grid.GridPanel -> enableDragDrop : true & CheckboxSelectionModel
hi team,
i just tried to combine a GridPanel with CheckboxSelectionModel and enableDragDrop and noticed, that nothing happens when you click on a checkbox as soon as enableDragDrop is set to true.
to reproduce this, it is important to use the config:
with checkOnly : false, it works fine.Code:var sm = new Ext.grid.CheckboxSelectionModel({ checkOnly : true });
for a testcase use examples/grid/grid-plugins.html
and change grid-plugins.js:
best regardsCode://////////////////////////////////////////////////////////////////////////////////////// // Grid 2 //////////////////////////////////////////////////////////////////////////////////////// var sm = new xg.CheckboxSelectionModel({ checkOnly : true }); var grid2 = new xg.GridPanel({ enableDragDrop : true, store: new Ext.data.Store({ reader: reader, data: xg.dummyData }), cm: new xg.ColumnModel({ defaults: { width: 120, sortable: true }, columns: [ sm, {id:'company',header: "Company", width: 200, dataIndex: 'company'}, {header: "Price", renderer: Ext.util.Format.usMoney, dataIndex: 'price'}, {header: "Change", dataIndex: 'change'}, {header: "% Change", dataIndex: 'pctChange'}, {header: "Last Updated", width: 135, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'} ] }), sm: sm, columnLines: true, width:600, height:300, frame:true, title:'Framed with Checkbox Selection and Horizontal Scrolling', iconCls:'icon-grid', renderTo: document.body });
tobiu
-
17 Feb 2011 3:23 AM #2
Hi Tobias,
Many thanks for sharing your solution - you've just saved me a lot of time searching!
Regards,
Andy
-
17 May 2011 6:54 AM #3
-
19 May 2011 5:16 AM #4
hi team,
i needed a fast solution, so:
it would be nice, if this gets into svn.Code:Ext.override(Ext.grid.GridDragZone, { getDragData : function(e){ var t = Ext.lib.Event.getTarget(e); var rowIndex = this.view.findRowIndex(t); if(rowIndex !== false) { var sm = this.grid.selModel; if (sm instanceof(Ext.grid.CheckboxSelectionModel)) { sm.onMouseDown(e, e.getTarget()); } else if(!sm.isSelected(rowIndex) || e.hasModifier()) { sm.handleMouseDown(this.grid, rowIndex, e); } return {grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, selections:sm.getSelections()}; } return false; } });
best regards
tobiu
-
10 Jun 2011 4:07 AM #5
with this fix, it should behave completely natural
PHP Code:Ext.override( Ext.grid.GridDragZone, {
getDragData : function( e ) {
var t = Ext.lib.Event.getTarget(e);
var rowIndex = this.view.findRowIndex(t);
if ( rowIndex !== false ) {
var sm = this.grid.selModel;
if ( sm instanceof( Ext.grid.CheckboxSelectionModel ) ) {
sm.onMouseDown( e, t );
}
if( t.className != 'x-grid3-row-checker' && ( !sm.isSelected( rowIndex ) || e.hasModifier() ) ) {
sm.handleMouseDown( this.grid, rowIndex, e );
}
return { grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, selections:sm.getSelections() };
}
return false;
}
} );
-
13 Jul 2012 12:46 AM #6
-
15 Jul 2012 1:52 PM #7
What is the bug number for this problem? It was reported 29 months ago.
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
set grid both enableDragDrop true and CheckboxSelectionModel false
By Rooock in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 11 Jan 2010, 7:26 AM -
[2.1][FIXED] GridPanel: enableDragDrop: true makes rowselect fire twice
By wuschba in forum Ext 2.x: BugsReplies: 4Last Post: 3 Sep 2009, 6:12 PM -
How to deselect a grid row when enableDragDrop is true
By allpuser in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 24 Sep 2008, 11:08 PM


Reply With Quote