PDA

View Full Version : [FIXED] DragDrop with cellmodel selection breaks selectionmodel



kvr
17 Sep 2013, 6:31 AM
Problem with grid using gridviewdragdrop and cellmodel

Ext version tested:

Ext JS 4.2.1-commercial


Browser versions tested against:


FF
Chrome

Description:

Doing a dragdrop of a row breaks the selection. It becomes impossible to select anything and the drag-dropped column remains checked forever.

Steps to reproduce the problem:

Create a grid with dragdrop and cellmodel selection.
Drag and drop a row.
Try to select anything. (or try to save a form or something that affects the selection)

The result that was expected:

Being able to select something.

The result that occurs instead:

the drag-dropped cell remains checked.

Test Case:



<html>
<link rel="stylesheet" type="text/css" href="/ext/resources/css/ext-all.css?1376988545.0">
<script src="/ext/ext-all-debug.js?1376988544.0"></script>

<script>
Ext.onReady(function () {
Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['name', 'email', 'phone'],
data:{'items':[
{ 'name': 'Lisa', "email":"[email protected]", "phone":"555-111-1224" },
{ 'name': 'Bart', "email":"[email protected]", "phone":"555-222-1234" },
{ 'name': 'Homer', "email":"[email protected]ons.com", "phone":"555-222-1244" },
{ 'name': 'Marge', "email":"[email protected]", "phone":"555-222-1254" }
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});

Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
],
viewConfig: {
markDirty: false,
plugins: {
ptype: 'gridviewdragdrop',
dragText: 'Drag and drop to reorganize'
},
},
selType: 'cellmodel',
height: 200,
width: 400,
renderTo: Ext.getBody()
});

})
</script>
</html>



Possible Fix:

grid.getSelectionModel().selection = null

Operating System:

Ubuntu Linux

Gary Schlosberg
17 Sep 2013, 8:23 AM
Thanks for the report! I have opened a bug in our bug tracker.