Hi Kalpesh,

    Thank you so much for your help and valuable time with me.It's
working fine as i expected.

         If you don't mine and if you have enough time, i will tell
you one more problem that how do i construct dynamic nested
ArrayCollection looks like

                    var initData:ArrayCollection = new ArrayCollection
([
                         {author:"xxxxx" ,
edition:"2nd",publishedDate:"20-03-2003", childern:
[{bookName:"Java",price:"600",pages:"567"}]
                         }
                   ]);

          See the problem is that i am storing the author information
in one table and book information in another table and when i get the
data at front end those are 2 different objects like

               var authorData:ArrayCollection = new ArrayCollection
([ {author:"xxxxx" , edition:"2nd",publishedDate:"20-03-2003"}  ]);
               var authorData:ArrayCollection = new ArrayCollection
([ {bookName:"Java",price:"600",pages:"567"}  ]);

       I need to build the nested ArrayCollection shown above.

      How do i do that? Is is possible? and am extremely sorry if am
disturbing you.

 Thanks
      sankar


On Mar 5, 5:25 pm, kalpesh mahida <[email protected]> wrote:
> try out below code. I hope this time you will get your answer, please reply
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
>   width="525" height="270" creationComplete="creationHandler();" >
>   <mx:Script>
>     <![CDATA[
>       import mx.events.DragEvent;
>       import mx.managers.DragManager;
>       import mx.core.DragSource;
>       import mx.collections.ArrayCollection;
>       import mx.controls.List;
>       import mx.core.UIComponent;
>       import mx.controls.Alert;
>       import mx.events.ListEvent;
>
>       private function creationHandler():void {
>         bookList.dataProvider = new ArrayCollection([
>         {data:0, label:'name 1'},
>         {data:1, label:'name 2'},
>         {data:2, label:'name 3'}
>         ]);
>         categoryList.dataProvider = new ArrayCollection([
>         {data:0, label:'cat 1'},
>         {data:1, label:'cat 2'},
>         {data:2, label:'cat 3'}
>         ]);
>       }
>       private function acceptIt(event:DragEvent):void {
>               DragManager.acceptDragDrop(UIComponent(event.target));
>           }
>           private function performDrop(event:DragEvent):void {
>             var dropIndex:int = (event.currentTarget as
> List).calculateDropIndex(event);
>             Alert.show("Label
> ::"+categoryList.dataProvider[dropIndex].label);
>           }
>     ]]>
>   </mx:Script>
>   <mx:HBox width="100%" height="100%">
>     <mx:List id="bookList"
>       width="100%" height="100%"
>       dragEnabled="true"
>       dragMoveEnabled="false" />
>     <mx:List id="categoryList"
>       width="100%" height="100%"
>       dragMoveEnabled="false" dragEnter="acceptIt(event)"
> dragDrop="performDrop(event)"  />
>   </mx:HBox>
> </mx:Application>
>
> Regards,
> Kalpesh Mahida
>
> On Thu, Mar 5, 2009 at 2:55 PM, Sankar <[email protected]> wrote:
>
> > Hi,
>
> >               doing the same thing as you said.Before start dragging
> > am holding the information in one object and doing the drag.See but
> > the problem is i will choose my dropping item dynamically and am not
> > able to get the selected item label of dropping item on dragDrop()
> > method.
>
> >  Can you tell me how do i get the lable for dropping item on dragDrop
> > () method. If you don't mine can you give me your gmail id so that i
> > can contact you.
>
> >  Thanks
> >   sankar
>
> > On Mar 5, 1:40 pm, kalpesh mahida <[email protected]> wrote:
> > > Define two object say currentlyDragingItem and currentlyDropingItem and
> > > store some info in currentlyDragingItem while you start dragging and in
> > > currentlyDropingItem while you enter to drop event and then fire the
> > query
> > > you want and then reset the objects with null values.
>
> > > Regards,
> > > Kalpesh Mahida
>
> > > On Thu, Mar 5, 2009 at 10:58 AM, Sankar <[email protected]>
> > wrote:
>
> > > > yah as you  people told, first  you have to select the item and you
> > > > can get the selected index on mouseOver or mouseOut. But i don't want
> > > > in this way.
>
> > > >  i mean i will not select any item first.When i come over the item i
> > > > should get the selected index. I think it's not possible because you
> > > > can get the selected index only when you select the item(click).
>
> > > >  If there is a way let me know.
>
> > > > Thanks
> > > >  sankar
>
> > > > On Mar 4, 9:57 pm, Neeraj <[email protected]> wrote:
> > > > > ya you can get , use mouse over event
>
> > > > > On Mar 4, 4:47 pm, Carvalhar <[email protected]> wrote:
>
> > > > > > well, i think you can in mousevor first define the item as selected
> > > > > > then pass it...
>
> > > > > > On Mar 4, 3:53 am, Sankar <[email protected]> wrote:
>
> > > > > > > Hi ,
>
> > > > > > > am using the List control to display the data and it has a
> > > > > > > itemRenderer also.
>
> > > > > > > Now the question is, can we get the selectedItem or selectedIndex
> > > > when
> > > > > > > i place mouse over the item in the List control?
>
> > > > > > > Is it possible?
>
> > > > > > > Thanks
> > > > > > > sankar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to