Copy to Clipboard question

jmoises

Active Member
Hello i found a js file that can help me on something i need, but i need some direction/advise

i manage to install this https://clipboardjs.com/ js file to template.

i also create php button in the list

the idea is to be able to copy the value of and element to clipboard and planing to use in the secction "JS code" and put some js code to copy the value of the element in the select row, but i cant find how to acomplish this.

Sample of use:
<!-- Target --> <input id="foo" value="https://github.com/zenorocha/clipboard.js.git"> <!-- Trigger --> <button class="btn" data-clipboard-target="#foo"> <img src="assets/clippy.svg" alt="Copy to clipboard"> </button>

Maybe is better to create a Button Element?

thanks for any help

EDIT: Button Element is not render in List, so was not able to test it.
 
Last edited:
ok. i have trying to get the value of and element when click but no success :( can you give me and example ?

thanks
 
ok i manage to get the current row, element like this:
console.log(rows[ids].table___element_raw);
know i need to copy to clipboard
 
We provide the selected rows data in an object called rows. So something like this ...

Code:
jQuery.each(rows, function(k, row) {
   // data will be in row.yourtable___elementname
}));

-- hugh
 
Thanks Hugh, like i said i am try to use this https://clipboardjs.com/ js library,i manage to get the Value or Text i need to copy to clipboard, but i cant make it work

this is the element value that i need to copy for sample

rows[ids].table___element_raw

if i use some like this console.log(rows[ids].table___element_raw); it the correct text.

Here is some info of how to activate this JS library hope you can help me.


Advanced Usage

If you don't want to modify your HTML, there's a pretty handy imperative API for you to use. All you need to do is declare a function, do your thing, and return a value.

For instance, if you want to dynamically set a target, you'll need to return a Node.

Code:
new Clipboard('.btn', {
target: function(trigger) {
return trigger.nextElementSibling;
}
});

If you want to dynamically set a text, you'll return a String.

Code:
new Clipboard('.btn', {
text: function(trigger) {
return trigger.getAttribute('aria-label');
}
});
 
but in order to copy to clipboard for some reason i need to Click 2 times the JS List Element.
 
Nope. I'd have to get my hands on the code to figure that out. Do you have a site I can look at?

Although this is a bit out of scope for subscription support. If it's not an obvious / quick fix, I'd have to charge it as custom work.

-- hugh
 
mm ok i think many user may need element copy to clipboard i almost made it work, but only need to click to mouse to copy, so no biggie then,.

thanks
 
It would no doubt be a useful feature, but we can't just implement every useful feature everyone wants. Typically if we get a lot of requests for something, we can do it on the "it adds value to Fabrik" basis, but you are the only person to ever ask for this, so it's not something which is going to pay for itself in extra users/subscriptions. That's the problem with subscription support. Your sub pays for X minutes of our time, and doing any kind of "development" eats that time up REALLY fast (case in point, how long have you spent working on this?). So we have to balance "adding value to Fabrik" against "paying the rent".

Typically with features like this, where it's a feature which others might find useful, I'll split the time (and hence cost) 50/50.

-- hugh
 
Hugh, sometime my English is not the best and misunderstood happend, Most of my post i am asking for guide so i can know where to search or go, i compleaty understand when some task require more time and need to make extra charge and i dont mind pay when somebody help me, is not the first time you post some similar text to my post and again i tell you just thell me ?How Much? and if i can pay it no big deal, i know you guys have a lot of work and you need to cost your time and i agree!!!,

:)
 
BTW, i found why i need to click 2 times, is because is not check it, so here is what i thing is missing in the JS List Plugin,

Button in row & Require Checked

Like the PHP List Plugin.

e0e5a0f93597254b368617ee40c1576e.png

https://gyazo.com/e0e5a0f93597254b368617ee40c1576e
 
Hugh, sometime my English is not the best and misunderstood happend, Most of my post i am asking for guide so i can know where to search or go, i compleaty understand when some task require more time and need to make extra charge and i dont mind pay when somebody help me, is not the first time you post some similar text to my post and again i tell you just thell me ?How Much? and if i can pay it no big deal, i know you guys have a lot of work and you need to cost your time and i agree!!!,

:)

:)

I didn't mean to sound grumpy. Just making sure we understand each other.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top