成功EXT single用法1
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test1.aspx.cs" Inherits="WebApplication1.ext1.event1.single1.test1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<link href="https://baijiahao.baidu.com/css/test1.css" rel="stylesheet" type="text/css" />
<script src="https://baijiahao.baidu.com/resources/extjs/ext-2.2/adapter/ext/ext-base.js" type="text/javascript"></script>
<script src="https://baijiahao.baidu.com/resources/extjs/ext-2.2/ext-all.js" type="text/javascript"></script>
<script type="text/javascript">
function ee() {
var e1 = Ext.fly("div1");
e1.on('click', function (e, t) {
alert("div1");
}, this, {
single: true // 触发一次后不会再执行事件了
});
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="div1" class="test">
<ul style="list-style-type:none;">
<li>a</li>
<li>b</li>
<li>c</li>
<li>d</li>
<li>e</li>
<li>f</li>
</ul>
<div id="div1_sub">div1_sub</div>
</div>
<div id="div2">
div2
<div id="div2_sub1">div2_sub1</div>
<div id="div2_sub2">div2_sub2</div>
</div>
<div id="div3">div3</div>
<input type="button" value="test" onclick="ee();" />
</form>
</body>
</html>