1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    74
    Vote Rating
    2
    url is on a distinguished road

      0  

    Default Unanswered: Dropping a panel inside a div in ext4.1

    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?

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,357
    Answers
    432
    Vote Rating
    200
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    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.

Thread Participants: 1

Tags for this Thread