PDA

View Full Version : Drag/Drop : reporte designer



abdelaat
2 Dec 2011, 3:36 AM
Hi all,
I want to develope a report designer as below where i have a toolbox contained in a panel (many labels and eventually other widgets that i should be able to drop on the report designer) and a container (zone of the drop) that should receive a copy of every widget that i drag from the toolbox to this container.

1st question : what is the best way to do this : should I use extjs widgets like labels textfields that i put on the toolbox from the extdesigner, or i should use plain html divs instead ?

2nd question : if i use extjs widgets that i create from the extdesigner and add drag behaviour like this :


for(i=0; i<toolBox.items.getCount(); i++)
{
item = toolBox.items.get(i);
new Ext.dd.DDProxy(item.getEl(), 'ddGroup');
}


and drop behaviour like this :


new Ext.dd.DDTarget(this.rptDesign.getEl(), 'ddGroup');


I remark that when i drag a tool from the toolbox, it can't be dropped over the container zone of drop, i think because the tool widget is contained under the panel of toolbox so it can't leave it's container panel, so i thougt to create a copy of the widget that is dragged witch is not contained under the panel of the toolbox it can be dropped over the container drop zone, is that a good idea? if yes how could i implement it ? otherwise could you propose me a solution to simplify developement of this reportdesigner ?


Thanks very much in advance.

29753