PDA

View Full Version : drag&drop columns from grid column to toolbar and button from toolbar to grid column?



silent
25 Nov 2011, 4:39 AM
Hi,

I'm in trouble in dealing with two drag&drop actions.

I've build a bordered layout.

The 'north' area is a simple toolbar component where only some small containers (DIV tags) are placed.

The 'center' area is a grid panel with no columns.

All I want to do is:
Dragging one of the container box to the grid adds a new column to the grid -> this works as expected!
Dragging one column to the toolbar remove this column -> does not work!

For that I've added 2 dragZone's and 2 dropZones:
- 1 dragZone is the whole toolbar
- 1 dropZone is the whole toolbar -> inner logic if dragged element can be dropped here is avail.
- 1 dragZone is the whole grid
- 1 dropZone is the whole grid -> inner logic if dragged element can be dropped here is avail.

So, for now there must be a error in calling my 'on'-Methods, I expected that the 'onNodeEnter' method for each dropZone would be called when I drag something over it. But this does not work - instead it calls only the onNodeEnter method of one of the dropZone! What's the problem here? In my opinion this is very very poor documented on the Ext docs. There are no examples of multiple drag&drops :(

I've also tried to set a 'ddGroup' - no luck!

Any help would be appreciated!

mitchellsimoens
25 Nov 2011, 9:15 AM
So the problem is trying to detect when a column is dragged over the toolbar?

Pranoti
3 Dec 2011, 9:56 AM
I am new to Sencha...trying to implement the same functionality. can you please share the code?

Thanx,
Pranoti.


[QOTE=silent;679693]Hi,

I'm in trouble in dealing with two drag&drop actions.

I've build a bordered layout.

The 'north' area is a simple toolbar component where only some small containers (DIV tags) are placed.

The 'center' area is a grid panel with no columns.

All I want to do is:
Dragging one of the container box to the grid adds a new column to the grid -> this works as expected!
Dragging one column to the toolbar remove this column -> does not work!

For that I've added 2 dragZone's and 2 dropZones:
- 1 dragZone is the whole toolbar
- 1 dropZone is the whole toolbar -> inner logic if dragged element can be dropped here is avail.
- 1 dragZone is the whole grid
- 1 dropZone is the whole grid -> inner logic if dragged element can be dropped here is avail.

So, for now there must be a error in calling my 'on'-Methods, I expected that the 'onNodeEnter' method for each dropZone would be called when I drag something over it. But this does not work - instead it calls only the onNodeEnter method of one of the dropZone! What's the problem here? In my opinion this is very very poor documented on the Ext docs. There are no examples of multiple drag&drops :(

I've also tried to set a 'ddGroup' - no luck!

Any help would be appreciated![/QUOTE]

Pranoti
3 Dec 2011, 10:09 AM
I am new to Sencha, would want to implement the same functionality
Can you please share the code?

Thax,
Pranoti.