PDA

View Full Version : Drag and Drop grid-to-grid unresponsive script



Nopkev
8 Aug 2013, 12:27 AM
Good morning,

i got a Problem with dd grid-to-grid. If i drop a Item from one Grid to a other my Firefox say that the script is unresponsive. This message and the collapse of the script is random and i cant determine it.
it would be great if someone can help me.

My grids:



Ext.define('FM.view.listener.grids', {
extend: 'Ext.container.Container',
alias: 'widget.grids',
margin: '300 0 0 255',
requires: [
'Ext.grid.*',
'Ext.layout.container.HBox',
'FM.model.current_listener'
],
xtype: 'dd-grid-to-grid',


width: 650,
height: 300,
layout: {
type: 'hbox',
align: 'stretch',
padding: 5
},

initComponent: function(){
var group1 = this.id + 'group1',
group2 = this.id + 'group2',
columns = [ {header: 'id', dataIndex: 'id', width: 80},
{header: 'name', dataIndex: 'name', width: 100},
{header: 'Typ', dataIndex: 'typ', width: 200},
{header: 'Data1', dataIndex: 'data1', width: 200},
{header: 'Data2', dataIndex: 'data2', width: 200},
{header: 'Data4', dataIndex: 'Data4', width: 200},
{header: 'dataname', dataIndex: 'dataname', width: 200}];
this.items = [{
itemId: 'grid1',
flex: 1,
xtype: 'grid',
multiSelect: false,
viewConfig: {
plugins: {
ptype: 'gridviewdragdrop',
dragGroup: group1,
dropGroup: group2
},
listeners: {
drop: function(node, data, dropRec, dropPosition) {
var dropOn = dropRec ? ' ' + dropPosition + ' ' + dropRec.get('name') : ' on empty view';
}
}
},
store:'current_listeners',

columns: columns,
stripeRows: true,
title: 'First Grid',
tools: [{
type: 'refresh',
tooltip: 'Reset both grids',
scope: this,
handler: this.onResetClick
}],
margins: '0 5 0 0'
}, {
itemId: 'grid2',
flex: 1,
xtype: 'grid',
multiSelect: false,
viewConfig: {
plugins: {
ptype: 'gridviewdragdrop',
dragGroup: group2,
dropGroup: group1
},
listeners: {
drop: function(node, data, dropRec, dropPosition) {
var dropOn = dropRec ? ' ' + dropPosition + ' ' + dropRec.get('name') : ' on empty view';
}
}
},
store:'listeners',
columns: columns,
stripeRows: true,
title: 'Second Grid'
}];

this.callParent();
},

onResetClick: function(){
//refresh source grid
this.down('#grid1').getStore().loadData(this.myData);

//purge destination grid
this.down('#grid2').getStore().removeAll();
}
});

ShariWilkins
8 Aug 2013, 2:14 AM
The grids look pretty much complicated..i guess they are quite messy..you might wanna rearrange them according to the sizes and you may come up with some positive results.

Nopkev
8 Aug 2013, 2:48 AM
Now is split the one view into a first grid and second grid.

The first view:



Ext.define('FM.view.listener.listeners', {
extend: 'Ext.grid.Panel',
alias: 'widget.listeners',
store: 'listeners',
title: 'Alle Empfänger',
width: 590,
height: 200,
margin: '300 0 0 847',
viewConfig: {
plugins: {
ptype: 'gridviewdragdrop',
dragGroup: 'firstGridDDGroup',
dropGroup: 'secondGridDDGroup'
},
listeners: {
drop: function(node, data, dropRec, dropPosition) {
Ext.Ajax.request({
method: 'GET',
params: {
job_id: MySharedData.job_nummer,
versand_id: data.records[0].get('versand_id')
},
url: 'data/current_listeners_delete.php'
});
}
}
},
initComponent: function () {

this.columns = [
{header: 'id', dataIndex: 'id', width: 80},
{header: 'name', dataIndex: 'name', width: 100},
{header: 'Typ', dataIndex: 'typ', width: 200},
{header: 'Data1', dataIndex: 'data1', width: 200},
{header: 'Data2', dataIndex: 'data2', width: 200},
{header: 'Data4', dataIndex: 'Data4', width: 200},
{header: 'dataname', dataIndex: 'datanem', width: 200}
];
this.callParent(arguments);
}
});


And the second view is:



Ext.define('FM.view.listener.current_listeners', {
extend: 'Ext.grid.Panel',
alias: 'widget.current_listeners',
store: 'current_listeners',
title: 'Empfänger der Ausgewählten Meldung',
width: 590,
height: 200,
margin: '300 0 0 255',
viewConfig: {
plugins: {
ptype: 'gridviewdragdrop',
dragGroup: 'secondGridDDGroup',
dropGroup: 'firstGridDDGroup'
},
listeners: {
drop: function(node, data, dropRec, dropPosition) {
Ext.Ajax.request({
method: 'GET',
params: {
job_id: MySharedData.job_nummer,
versand_id: data.records[0].get('versand_id')
},
url: 'data/current_listeners_save.php'
});
}
}
},
initComponent: function () {
this.columns = [
{header: 'id', dataIndex: 'id', width: 80},
{header: 'name', dataIndex: 'name', width: 100},
{header: 'Typ', dataIndex: 'typ', width: 200},
{header: 'Data1', dataIndex: 'data1', width: 200},
{header: 'Data2', dataIndex: 'data2', width: 200},
{header: 'Data4', dataIndex: 'Data4', width: 200},
{header: 'dataname', dataIndex: 'datanem', width: 200}
];
this.callParent(arguments);
}
});

Nopkev
8 Aug 2013, 6:20 AM
Can you close this Thread? plz

Thx for help :)