lehmanjas
asked on
Show Flex Datagrid as busy while loading and reloading
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="{repRoleUser sXLC}" width="100%" height="90%"
id="AssUsersDG"
updateComplete="this.enabl ed=true"
creationComplete="this.ena bled=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.
<mx:DataGrid dataProvider="{repRoleUser
id="AssUsersDG"
updateComplete="this.enabl
creationComplete="this.ena
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.
ASKER
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.
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="{repRoleUser sXLC}" width="100%" height="90%"
id="AssUsersDG"
updateComplete="currentSta te=null"
creationComplete="currentS tate='load ing'"/>
<mx:DataGrid dataProvider="{repRoleUser
id="AssUsersDG"
updateComplete="currentSta
creationComplete="currentS
<?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>
ASKER
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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'
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'
did you get my mail?
ASKER
Thank you so much for your help.
Open in new window