<script>
Ext.ns('clipBoard');
clipBoard.data = '';

function copyClipBoard() {
_D('clipBoardData');

console.log('clipBoard.data:'+clipBoard.data);
var s = clipBoard.data;

var div = document.createElement('div');
div.innerText = '"' + s + '" copied to clipboard.';
document.body.appendChild(div);

if (window.clipboardData)
window.clipboardData.setData('text', s);
else
return (s);
}
</script>

xxx.js

於object的itmes中加入

{
border: false,
html: "<object id='clipboard{[this.getClipboardId(values)]}' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='16' height='16' align='middle'>"+
"<param name='allowScriptAccess' value='always' />"+
"<param name='allowFullScreen' value='false' />"+
"<param name='movie' value='clipboard.swf' />"+
"<param name='quality' value='high' />"+
"<param name='bgcolor' value='#ffffff' />"+
"<param name='flashvars' value='callback=copyClipBoard&callbackArg={[this.getClipboardId(values)]}' />"+
"<embed src='clipboard.swf' flashvars='callback=copyClipBoard&callbackArg={[this.getClipboardId(values)]}' quality='high' bgcolor='#ffffff' width='16' height='16' name='clipboard{[this.getClipboardId(values)]}' align='middle' allowscriptaccess='always' allowfullscreen='false' type='application/x-shockwave-flash' pluginspage='http://www.adobe.com/go/getflashplayer' />"+
"</object>"
}

 

最重要的.swf檔放在跟xxx.js同資料夾下

https://skydrive.live.com/embed?cid=D252BFEC9439708B&resid=D252BFEC9439708B%21624&authkey=AKbo8PUlJDgTJag

狼翔月影 發表在 痞客邦 PIXNET 留言(0) 人氣()