---
title: "How to make extjs grid selectable"
author: "standalone"
date: "2012-07-05T14:42:00Z"
tags: []
categories: ["编程语言"]
slug: "how-to-make-extjs-grid-selectable"
draft: false
lastmod: "2012-07-05T14:42:00Z"
id: 1577538
url: "https://standalone.iteye.com/blog/1577538"
---

```javascript

Ext.core.Element.prototype.unselectable = function() {
            var me = this;
            if (me.dom.className.match(/(x-grid-table|x-grid-view)/)) {
                return me;
            }
            me.dom.unselectable = "on";
            me.swallowEvent("selectstart", true);
            me.applyStyles("-moz-user-select:none;-khtml-user-select:none;");
            me.addCls(Ext.baseCSSPrefix + 'unselectable');
            return me;
        };

```



I copied the code from http://kevin.chibaole.com/135