Hi all,
I'm having a fair
amount of trouble getting an itemRenderer for a DataGrid to work correctly. I
have a drop down combo box that the users selects an option from then retrieves
data from a database based on that option. The data is then returned to the Flex
app and dropped in the ModelLocator (Cairngorm). I have a DataGrid that's
dataProvider property is bound to the ModelLocator. Everything in the datagrid
displays correctly except a ProgressBar itemRenderer. It will work for the first
execution, but if a different set of data (or even the same data, returned
again) is retrieved from the database it won't display correctly. I have tried
throwing an alert in the itemRenderer so I can see when it is being called, and
it seems that it is only run properly on the first execution, every attempt
after that, it doesn't fire for every record that is returned. I have tried
calling invalidateDiplayList() and validateNow() from the datagrid, but to no
avail. Does anyone have any ideas? I have posted the code for the itemRenderer
below. I put it in a HBox so that I can position it
correctly.
<?xml
version="1.0"?>
<mx:HBox
width="100%"
height="22"
xmlns:mx="http://www.adobe.com/2006/mxml"
verticalAlign="middle"
horizontalAlign="center"
creationComplete="initialiseProgressBar()">
<mx:Script>
<![CDATA[
private function initialiseProgressBar():void {
if (data) {
if (data.progress == 0) {
pbModuleProgress.indeterminate = true;
} else {
pbModuleProgress.setProgress(data.progress,100);
}
pbModuleProgress.label= String(data.progress) + "%";
}
}
]]>
</mx:Script>
<mx:ProgressBar fontWeight="normal" width="90%" id="pbModuleProgress" labelPlacement="center" minimum="0" maximum="100" mode="manual"/>
</mx:HBox>
<mx:HBox
width="100%"
height="22"
xmlns:mx="http://www.adobe.com/2006/mxml"
verticalAlign="middle"
horizontalAlign="center"
creationComplete="initialiseProgressBar()">
<mx:Script>
<![CDATA[
private function initialiseProgressBar():void {
if (data) {
if (data.progress == 0) {
pbModuleProgress.indeterminate = true;
} else {
pbModuleProgress.setProgress(data.progress,100);
}
pbModuleProgress.label= String(data.progress) + "%";
}
}
]]>
</mx:Script>
<mx:ProgressBar fontWeight="normal" width="90%" id="pbModuleProgress" labelPlacement="center" minimum="0" maximum="100" mode="manual"/>
</mx:HBox>
Thanks in
advance,
Pete
Pete Capra
Information Systems Coordinator
National
Institute of Training
p. (617) 3208 9455
m. 0411 043 305
f. (617)
3208 9855
a. PO Box 1744 Springwood Q
4127
www.niot.com.au
[EMAIL PROTECTED]
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Software development tool | Software development | Software development services |
Home design software | Software development company |
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___