Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
michelob #1
mx:Link in cell renderer
i have a cell renderer which uses a mx:link do display a shopping cart icon. i
want to be able to click it and add the line to the cart - a separate dataGrid.
i am currently able to drag and drop to the cart, but cannot figure out how to
send the data to the cart from the cell renderer. the problem to me looks like
that when the link is clicked, the dataGrid row is not 'techinically' selected.
any ideas?
thanks...
michelob Guest
-
Datagrid and Cell Renderer
Hi, I have a datagrid with a Hyperlink cell renderer. Is there a way to pass the data from the row to the cell renderer? I am having great... -
ComboBox Cell Renderer
I'm using a ComboBoxCell class that I got from the Macromedia website to display a ComboBox inside of a DataGrid component. The problem I'm having,... -
Row renderer vs. cell renderer
Cell renderer. I have done this, and it is pretty easy. I tried to make a sample but haven't had time to finish it. Basically, in the set value... -
Can ComboBox have cell-renderer
I need a combobox which has an image and text. I went through all the macromedia documentation , but could not find any thing on cell renderer. I... -
cell renderer book/tutorial ?
Does anyone know of a tutorial or book that covers the cell renderer in any depth? I've been trying to make a multiline cell renderer based on the... -
ntsiii #2
Re: mx:Link in cell renderer
I really haven't done all that much with cell renderers, so i am just thinking
aloud.
Have you checked listOwner.selectedItem and selectedIndex?
Also I found this in a different posting on a similar subject:
listOwner.getItemAt(getCellIndex().itemIndex).colu mnName
Maybe there are some hints there.
Tracy
ntsiii Guest
-
peterent #3
Re: mx:Link in cell renderer
In the click event handler for your cell renderer, do this:
listOwner.selectedIndex = getCellIndex().itemIndex; // this selects the row
listOwner.dispatchEvent( {type:"change"} );
This dispatches the change event to all of the listeners for such on the
DataGrid:
<mx:DataGrid change="handleChange(event)" ... />
In the change event handler, event.target.selectedIndex will tell you what has
been selected.
peterent Guest
-
michelob #4
Re: mx:Link in cell renderer
Peter,
your suggestion works for me but now when i do this:
function handleChange(event){
alert(event.target.selectedIndex.toString());
}
...i get 0, 1, 2, etc - but i cannot get it to display any of the row data...
i amy be overlooking something simple, but all i get back is blank alert
boxes...
thanks...
michelob Guest
-
peterent #5
Re: mx:Link in cell renderer
The selectedIndex is a number. Use it to index your dataProvider: event.target.dataProvider[event.target.selectedIndex]
peterent Guest
-
michelob #6
Re: mx:Link in cell renderer
sorry, i was forgetting to look at the dataProvider...but when i click the image - i get no response....when i click the row, i get my alert box...
where did i screw it up?
thanks...
michelob Guest
-
-
michelob #8
Re: mx:Link in cell renderer
ok i have found my way around the previous problem, but now the following is
happening....
i have my main.mxml which has main.as....i also have cart.mxml which has
cart.as...i have a shoppingCart.as class...in cart.as i have this code:
var dataObject:ShoppingCart; and i have a drag function which adds the item
like this: dataObject.addItem(my data)
in main.as i am trying to do the same thing but initiated by the click - not
the drag...i have:
var dataClickObject:ShoppingCart; and i have: dataClickObject.addItem(my
data)
the drag functiion puts the data in the cart, the click function will not. i
do know for sure that my object is getting to the function with
dataClickObject.addItem(my data) on the click because i can dump it to the
trace window - it just will not push it to the shoppingCart.as.
help! this is driving me crazy...
a side note...the image now works when clicked, but i want to dis-allow the
entire row from being clicked...any idea on that as well?
thanks!
mike
michelob Guest
-
michelob #9
Re: mx:Link in cell renderer
i have fixed all the problems and my add to cart icon is now working...there is
1 small problem remaining...the item will add to cart when the row is clicked
as well as just the icon. i set selectable=false and now only the icon works
which is what i want, but this disbaled the drag to cart...
HELP!!!!
thanks in advance...
mike
michelob Guest



Reply With Quote

