Solved

Show Flex Datagrid as busy while loading and reloading

Posted on 2008-10-22
8
8,179 Views
Last Modified: 2012-05-05
I am using showbusycursor on my HTTPService so that while the datagid is loading is that the cursor at least changes but I would like to do more like graying out the datagrid or something.  But I am not sure where to start I tried:

            <mx:DataGrid dataProvider="{repRoleUsersXLC}" width="100%" height="90%"
                                         id="AssUsersDG"
                                         updateComplete="this.enabled=true"
                                         creationComplete="this.enabled=false"/>

but it didn't do as expected it disabled the scroll bar but I hoped it would disable grid.  But I would like to do something that is really clear the data grid is loading and reloading thanks for any help.
0
Comment
Question by:lehmanjas
  • 4
  • 3
8 Comments
 
LVL 19

Expert Comment

by:Gary Benade
ID: 22784118
the grids updateComplete may not be the best place to show the grid as ready, it may be a better idea to do that in the onResult event of the dataprovider
<mx:DataGrid dataProvider="{repRoleUsersXLC}" width="100%" height="90%"
id="AssUsersDG"
updateComplete="this.enabled=true;this.mouseEnabled=true;this.alpha=1"
creationComplete="this.enabled=false;this.mouseEnabled=false;this.alpha=0.5"/>

Open in new window

0
 

Author Comment

by:lehmanjas
ID: 22787658
Thanks hobbit72 but it still doesn't really stand out because all the changes effect the scroll bar of the datagrid but not the datagrid itself.  I almost wish there was a way to have the showbusycursor appear over the datagrid or the datagrid itself had a loading effect while stuff was happening to it.  I am trying to mess with row colors now too to see if that helps.
0
 
LVL 19

Expert Comment

by:Gary Benade
ID: 22794012
You could use a loading state like I've shown you below, the loading text could be an animation or whatever you choose. In real use you would make this a custom component but to keep things simple I've just made it an app, and I've used a button to simulate the load but you would obviously change your events on the grid to do that instead:

<mx:DataGrid dataProvider="{repRoleUsersXLC}" width="100%" height="90%"
id="AssUsersDG"
updateComplete="currentState=null"
creationComplete="currentState='loading'"/>
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" currentState="loading">
	<mx:states>
		<mx:State name="loading">
			<mx:AddChild position="lastChild">
				<mx:Canvas width="600" height="374" backgroundColor="#000000" backgroundAlpha="0.5" x="10" y="10">
					<mx:Label text="Loading.." horizontalCenter="0" verticalCenter="0" fontSize="14"/>
				</mx:Canvas>
			</mx:AddChild>
			<mx:AddChild position="lastChild">
				<mx:Button x="236" y="428" label="Click to set loaded state" click="currentState=null"/>
			</mx:AddChild>
		</mx:State>
	</mx:states>
	<mx:DataGrid x="10" y="10" width="600" height="374">
		<mx:columns>
			<mx:DataGridColumn headerText="Column 1" dataField="col1"/>
			<mx:DataGridColumn headerText="Column 2" dataField="col2"/>
			<mx:DataGridColumn headerText="Column 3" dataField="col3"/>
		</mx:columns>
	</mx:DataGrid>	
</mx:Application>

Open in new window

0
Now Available: Firebox Cloud for AWS and FireboxV

Firebox Cloud brings the protection of WatchGuard’s leading Firebox UTM appliances to public cloud environments. It enables organizations to extend their security perimeter to protect business-critical assets in Amazon Web Services (AWS).

 

Author Comment

by:lehmanjas
ID: 22826650
I am not sure where to place the code above because I am new to states.  I tried to place in the middle of application but recieved an error saying states could not be located here.  I am going to look into custom components to see if I understand that better.
0
 
LVL 19

Accepted Solution

by:
Gary Benade earned 500 total points
ID: 22828788
Email me your file and I'll change it for you
gary at softwareguys.co.za
0
 
LVL 3

Expert Comment

by:chrisP4D
ID: 22887543
what about just replacing the data inside the datagrid with a temp array until the real data is loaded from the service?  i've done that a bunch of times where the datagrid will display a string of 'Loading Data' inside the first few columns of the datagrid.  Once the data query or service is done and loaded, change the dataprovider back to the correct arraycollection or whatever you are using to populate it.

it's a quick thing to do and it gets the point across.

the other thing you could do is make a titlewindow popup with an indeterminate progressbar and have it be modal so the user cant do anything until it goes away.  basically, when you send for the httpservice, also kick off the function to make the popup.  when the result comes back, have the progressbar's progress function be set to 100 and link that to a close popup window event.  Also instead of a progressbar, just put in a label or something saying 'Loading Data'
0
 
LVL 19

Expert Comment

by:Gary Benade
ID: 22902312
did you get my mail?
0
 

Author Closing Comment

by:lehmanjas
ID: 31508931
Thank you so much for your help.
0

Featured Post

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Flex GroupingCollection2 with Multiple GroupingFields 3 834
How popular is Java FX these days? 5 366
Button sound on mouseover 4 479
learning partner 1 228
First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Read our guide on how to survive being on-call.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question