留言板

Text is unselectable in aui-datatable

thumbnail
Chris Mount,修改在10 年前。

Text is unselectable in aui-datatable

New Member 帖子: 11 加入日期: 12-4-6 最近的帖子
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)





<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>

Jana Lampe,修改在8 年前。

RE: Text is unselectable in aui-datatable

New Member 帖子: 3 加入日期: 15-11-25 最近的帖子
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');
thumbnail
Byrån Zaugg,修改在8 年前。

RE: Text is unselectable in aui-datatable

Expert 帖子: 252 加入日期: 12-4-6 最近的帖子
There doesn't appear to be a property to disable unselectable. Not sure why thought.

I'm guessing that selections may have interfered with DataTable's other row/cell features....maybe? That's just a guess though.