Accessing component used as custom itemRenderer in Datagrid.

29 views
Skip to first unread message

sheetal

unread,
Dec 16, 2009, 1:11:14 AM12/16/09
to Flex India Community
Hi All,
I am using a panel with a Label on it as a csutom itemRenderer in a
Datagrid.On the click of the grid i make a call to get data for
selected item and want o display it.For this i need to access the
itemRenderer instance and the Label in it.Please share your ideas on
the same.


-sheetal

Akshar

unread,
Dec 16, 2009, 1:27:10 AM12/16/09
to Flex India Community
you can bind the text of the label to a variable. Then showing the
data is just a matter of changing the variable value.

sheetal

unread,
Dec 16, 2009, 1:57:14 AM12/16/09
to Flex India Community
Actually that is the issue.i am making the call after the component is
created.So binding is not helping.
I need to explicitly assign the value.I mean i have datagrid and may
values which i get only after calculation.

Akshar

unread,
Dec 16, 2009, 2:02:18 AM12/16/09
to Flex India Community
did you use [Bindable] while defining the variable.

sheetal

unread,
Dec 16, 2009, 2:41:38 AM12/16/09
to Flex India Community
Hey thanks for the Reply.
I cant use binding because i dont hv the data till i actually click on
the grid.

Akshar

unread,
Dec 16, 2009, 3:40:42 AM12/16/09
to Flex India Community
will the data be same for each row in the datagrid or will it be
different. i am not able to get the whole context of the problem.
here is what i understood about your problem:- you have a datagrid
having a custom itemrenderer. on clicking on the datagrid you want
that itemrenderer to show some data.

my questions:-
1) clicking on a particular row should show the data only in that row
or all the rows?
2) how are you populating your datagrid?
3) how do you get the data when user clicks?

sheetal

unread,
Dec 16, 2009, 4:28:34 AM12/16/09
to Flex India Community
Okie.
Here is how i can explain it all.
The panel header is the actaully arraycoll. data.That i am binding on
the parent grid.Now when u click on the row,i make a call to get data
for that row.Now the itemrenderer component has a datagrid whr data is
populated after some manipulation.I mean data i get is diff. from wat
i want to display.So,i make the changes for ex. i use a sort function
n all tht.Then i want to show it on the itemRen. comp.
Like
myitemRenderer.label.text=name;


For this how do i access renderer comp. for that row.

Akshar

unread,
Dec 16, 2009, 4:39:05 AM12/16/09
to Flex India Community
i still think feel that you can implement it by binding the text
property to some variable or to some data field of array collection of
objects.
just leave that variable empty in the beginnig and after doing the
calculations just populate it and call arraycollection.refresh()

sheetal

unread,
Dec 16, 2009, 4:56:25 AM12/16/09
to Flex India Community
Okie.will try something like tht.But is there no other way to access
the itemRenderer comp.?
Reply all
Reply to author
Forward
0 new messages