0
我在我的網格中添加了一個actioncolumn
。在actioncolumn
處理程序(單擊)我想使用zeroclipboard
庫將文本複製到剪貼板。Ext Js和zeroclipboard
我遇到了一些問題。有時我需要多次點擊我的actioncolumn
才能觸發副本。有時我必須刷新頁面才能觸發副本。
我actioncolumn處理程序:
handler: function(view, rowIndex, colIndex, item, e, record, row){
ZeroClipboard.config({moviePath: 'resources/js/zeroclipboard/ZeroClipboard.swf'});
var client = new ZeroClipboard(e.target);
client.on('load',function(client) {
client.on('datarequested', function(client) {
client.setText("Text to be copied");
});
client.on('complete', function(client, args) {
// alert("Copied text to clipboard: " + args.text);
Myapp.app.getController('UiNotification').showNotification("Link copied to clipboard");
});
});
}
一個可能的解決方法是設置mouseover
複製文本,但actioncolumn
沒有除處理任何其他事件。
請幫
我想通了,但無論如何感謝。我將zeroclipboard添加到了渲染器函數中。 – Jacob
@Jacob:您能否提供一個可用的示例?那太好了。 – Felix