I am using pyperclip.py to grab the content of a char field in just a button click and paste it anywhere, as that get copied to the clipboard. Its working perfect in the local system. While running it on server and access from client system through browser, it didn't get copied to the clipboard in client computer on button click. How can I make it copied to the clipboard of client system? please give a suggestion
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
1
Trả lời
12020
Lượt xem
You need to implement your solution in the browser, not on python. Take here an example of how to copy to clipboard in js, you just need to find a way to integrate it on a widget
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Copy to Clipboard Test</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
function copyToClipboard(element) {
$(element).select();
document.execCommand("copy");
}
</script>
</head>
<body style="text-align:center">
<input id="t1" type="text"/>
<button onclick="copyToClipboard('#t1')">Copy</button>
</body>
</html>
Axel, thank you for your answer. I tried using javascript also at that time, but was unable to copy to the clipboard, let me try with one.
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký