日期:2014-05-16  浏览次数:20411 次

ExtJS--10.3 Ext工具类 Ext.util.DelayedTask
<!DOCTYPE html>
<html>
<head>
	<title>Ext.util.DelayedTask</title>
	<meta name="content-type" content="text/html" charset="UTF-8">
	<link rel="stylesheet" type="text/css" href="../extjs4/resources/css/ext-all.css">
	<script type="text/javascript" src="../extjs4/bootstrap.js"></script>
	<script type="text/javascript">
		Ext.onReady(function(){
			var dt = new Ext.util.DelayedTask(function(){
				alert("---------");
			});
			Ext.get("btn01").on("click",function(){
				dt.delay("5000");
			});
			Ext.get("btn02").on("click",function(){
				dt.cancel();
			});
		});
	</script>
</head>
<body>
	<div style="text-align: center;">
		<input type="button" id="btn01" value="demo01">
		<input type="button" id="btn02" value="demo02">
	</div>
</body>
</html>

?