---
title: "重写EXT树的双击事件,让双击不展开子节点"
author: "wengsibo"
date: "2010-12-29T16:32:19Z"
tags: []
categories: ["Web前端"]
slug: "ext"
draft: false
lastmod: "2010-12-29T16:32:19Z"
id: 855002
url: "https://wengsb.iteye.com/blog/855002"
---

//重写树的双击事件,让双击不展开子节点

```js
Ext.override(Ext.tree.TreeNodeUI, {
		onDblClick : function(e) {
			e.preventDefault();
			if (this.disabled) {
				return;
			}
			if (this.checkbox) {
				this.toggleCheck();
			}
			if (!this.animating && this.node.hasChildNodes()) {
				var isExpand = this.node.ownerTree.doubleClickExpand;
				if (isExpand) {
					this.node.toggle();
				}
				;
			}
			this.fireEvent("dblclick", this.node, e);
		}
	});
```