Unanswered: Dropping a panel inside a div in ext4.1
I have a requirement where i should create a data view with some nested divs.
'<tpl>', '<div class='firstdiv' height:30 width:30 ></div>', '<div class='seconddviv' height:50 width:40 > </div>', '</tpl>'I have a panel with border layout in which west region contains the draggable treepanel(loads the list of widgets), and the dataview in center region. (In notify drop i will create the widgte and show the corresponding widget in drop target) I want to drag a widget from tree to dataview. If i'm dropping on the first div(#firstdiv) then it should fit to the first div and if I'm dropping in the second div(#seconddviv) then it should fit to second div. Can anybody suggest how to achieve?
You can render an unsized component directly to a div and the component will have the size of the owning div.
If the component has been rendered already you can move it into a div. You'll need to remove(cmp, false) it from its parent container and render() it to the div / element of your choice.
At this point the component will already have a size. Grab the size of the target div before you render() the component to it and you can then resize your component to the size of your div you're rendering to.