This content has been marked as final. Show 2 replies
"amthekkel" <email@example.com> wrote in message
> hi all,
> i have two tables one containing shifts and one containing shiftType. the
> shift table contains a foreign key to shiftType table. I am getting the
> from these tables as xml, from a ruby on rails application.
> On the flex side, i have two data grid, one that shows all the shifts and
> other that shows all the shift types. I have the xml data for shifts
> stored as
> XMLListCollection called shiftXLC and similary i have stored the xml data
> shiftType as XMLListCollection called shiftTypeXLC.
> i provide the first datagrid with the shfitXLC collection and displays the
> values. the only problem is since the shift xml data has a column called
> "ShiftType_ID" which is contains the foreign key to "ShiftType" table and
> contains a GUID. So this datagrid shows in its ShiftType_ID column a GUID
> is not ideal for a user.
> what i would like to be able to do is to display the actual shifttype name
> the associated shiftType_ID. I can display the information using an
> for that column and using a combobox that displays the ShiftTypeXLC as
> dataprovider and LabelField="ShiftTypeName".
> Is there a way to do this using a text control so that there is no awkward
> combo boxes hovering in the datagrid.
One way to do it is to have your XML that comes back (and I don't know how
ruby on rails handles this, but it can't be that different from other
technologies) be based on a query that joins the shift and shiftType tables
so that the shiftTypeName is also contained in the shiftXLC. Then you can
display it as you usually would display any bound data.
You could also use a labelFunction to look up the shiftTypeName in the
shiftType XMLListCollection and return the appropriate name.
thanks for the suggestion. I managed to get the required functionality using the labelFunction tip you had mentioned. I also agree with you that trying to get the xml data from Ruby on rails would have been the easier option and i was already trying to do that but was struggling with it. I am new to Ruby on rails as well, so its a new learning curve in for both flex and ROR.
But thanks anyway for your reply.