View Full Version : real time data display refresh in flex without click events
u_sutaria
08-05-2009, 07:28 PM
Hi,
I want to know how to refresh data in datagrid without having to use click event. Using click event, I know, it's achievable. But, I want to avoid any event and want to refresh the data every few seconds.
I tried to use infinite loop in ActionScript, but it won't work that way.
Also, FABridge or External Interface for AJAX won't be of any help, as I don't want to use click event at all.
Flash Communication server and data push technology seem to be a possibility but that would likely require a flash animation.
Thanks.
import flash.utils.Timer;
import flash.events.TimerEvent;
var t:Timer = new Timer(10000);
t.addEventListener(TimerEvent.TIMER, functName);
t.start();
function functName(e:TimerEvent):void {
trace("now would be a good time to refresh that datagrid");
}
u_sutaria
08-05-2009, 08:14 PM
import flash.utils.Timer;
import flash.events.TimerEvent;
var t:Timer = new Timer(10000);
t.addEventListener(TimerEvent.TIMER, functName);
t.start();
function functName(e:TimerEvent):void {
trace("now would be a good time to refresh that datagrid");
}
I am using Flex 3, It complains : 't' and 'functName' undefined property!
Still unresolved.
u_sutaria
08-05-2009, 08:44 PM
import flash.utils.Timer;
import flash.events.TimerEvent;
var t:Timer = new Timer(10000);
t.addEventListener(TimerEvent.TIMER, functName);
t.start();
function functName(e:TimerEvent):void {
trace("now would be a good time to refresh that datagrid");
}
Thanks for your invaluable help. I used t.xxx() in a function and it worked.
Priyaselvaraj
05-10-2010, 06:20 PM
Thanks for your invaluable help. I used t.xxx() in a function and it worked.
I dono how to refresh the datagrid..i got the same errors..pls tell wat u have done...
u_sutaria
05-10-2010, 11:42 PM
You'll have to use the timer t within a function itself.
u_sutaria
05-10-2010, 11:45 PM
Use the datagrid.additem() when calling the timer function.
bowla
12-01-2010, 02:18 PM
where do I add datagrid.additem()?
Peter Cowling
12-02-2010, 04:36 PM
where do I add datagrid.additem()?
The suggest is that you add an item to a datagrid - the datagrid therefore being a component.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.