留言板
Text is unselectable in aui-datatable
I have a simple aui-datatable and the text inside a row is not selectable when I use Y.Datatable instead of Y.DataTable.Base. The Examples on alloyui.com use both. Is there property or attribute that I need to set? I see in the CSS that when I click on a TD a .unselectable is being set.
Ex)
Ex)
<meta charset="utf-8">
<title>AUI DataTable </title>
<div id="x"></div>
<script src="http://cdn.alloyui.com/2.0.0/aui/aui-min.js"></script>
<link href="http://cdn.alloyui.com/2.0.0/aui-css/css/bootstrap.min.css" rel="stylesheet">
<script>
YUI().use(
'aui-datatable',
function (Y) {
var data = [
{ name: 'Frank Zappa', age: 71 },
{ name: 'Frank Lloyd Wright', age: 144 },
{ name: 'Albert Einstein', age: 132 },
{ name: 'Buckaroo Bonzai', age: 64 },
{ name: 'Egg Shen', age: 84 },
{ name: 'Colonel Mustard', age: 68 },
{ name: 'Peter Sellers', age: 86 }
];
var table = new Y.DataTable({ //var table = new Y.DataTable.Base({
columns: [
{ key: "name" },
{ key: "age"}
],
data: data,
});
table.render('#x');
});
</script>
I had the same issue. After spending some hours, I found out that it was sufficient to remove all subscribed "mousedown"-events, i.e.
datatable.get('contentBox').purge(true,'mousedown');
datatable.get('contentBox').purge(true,'mousedown');