Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2009
    Location
    Worcester
    Posts
    172
    Thanks
    13
    Thanked 6 Times in 6 Posts

    Lists within lists???

    Hi all

    I have a little problem, i have a list control that displays items from my database, and i'm using an item renderer to display in the list. In that item renderer i have another list that displays sub items of the previous list (if that makes sence?) and then a final itemRenderer within that one!

    here's the code for the first list:
    Code:
    				<mx:List dataProvider="{myData}" 
    					id="listTesting" 
    					itemRenderer="views.subListView"  
    					themeColor="#FFFFFF"
    					 borderStyle="none" 
    					 paddingRight="10" 
    					 columnWidth="590" right="0"  top="30" 
    					 variableRowHeight="true"
    					 rowCount="{listTesting.dataProvider.length}" 
    					 left="18" bottom="0" />
    And that displays everything fine, then i have this itemRenderer:
    Code:
    <mx:Canvas width="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" height="100%">
    			<mx:List id="subListDisplay" 
    				dataProvider="{mySubData}" 
    				itemRenderer="views.finalDisplay" 
    				borderStyle="none" 
    				change="getDetails(event)" 
    				click="getDetails(event)"
    				rowCount="{subListDisplay.dataProvider.length}"
    				right="0" top="0" left="0" >
    			</mx:List>
    		</mx:Canvas>
    And then I have a single canvas as an itemRenderer that shows the info.

    Problem is i can't seem to access the final itemRenderer, everything shows fine with all the correct data, but I cannot select anything.

    I've tried putting a 'change' function on every list right down to the itemRenderer one at a time and nothing happens!

    I'm just trying to show an alert at the moment so that i know that the item has been clicked, but wherever i put the alert it doesn't register, so therefore i can't bring up the details of the selected item.

    Should i just use a repeater first and then a list, or a list first with the sub data in a repeater within the itemRenderer? Or is there a way to access the item that i've clicked from another fuvtion other than 'change'? (I've already tried 'click' on all three seperatly)

    Surly it shouldn't be this hard to 'burrow' down through the lists and have the click/change event register?

    Any help would be gratefully recieved as always

    Many thanks in advance!

  • #2
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,005
    Thanks
    58
    Thanked 10 Times in 10 Posts
    In your bottommost render get it to fire a custom event that is heard by your application and then act apon that.



  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •