PDA

View Full Version : Can't copy values from two text fields at once



twinkleni
5 Jun 2014, 1:55 PM
Hello,

Our application needs to copy id and name at once, both are two different textfields. But I can copy only one value at a time either id or name.

Please help. Thanks.

scottmartin
5 Jun 2014, 8:27 PM
Can you elaborate a bit as to exactly what you are trying to achieve and how?

twinkleni
6 Jun 2014, 6:33 AM
Hi,

I have a form and I had some textfields in it. My application needs to copy the values in two text fields at once.But what happens is if I put my cursor on first field, it focuses only on first field I can't drag it to second field. So I can only copy value in first field.

49255

I attached an image, it is has First and Middle, I want to copy both at once. But I can put focus only on one field i.e First as shown in image. So how can I copy these both values at once? Do I need to change it to table or something??

Hope it is clear now.

Thank you.

scottmartin
6 Jun 2014, 9:42 AM
Can you use form.getValues() to get the needed values in the form on your drop event?

twinkleni
6 Jun 2014, 12:44 PM
Yeah I can get form.getValues(), but a client will copy paste the value from UI. So how will form.getValues() help?

I want to make my question clear, so I repeat :
49262
The user is able to see the UI shown in image below(this is our app, early was an example I took) and he wants to copy the values that I striked out at one shot itself. But we can copy either CSE NO. text field or CSE Alias textfield.

Thanks.

drunkmoose
6 Jun 2014, 12:54 PM
As suggested, use getValues() then join all these values and copy to clipboard yourself ? You could notify the user the clipboard now holds the data you want them to be able to copy all at once.

twinkleni
6 Jun 2014, 1:55 PM
Thanks for clarifying it. I want to let you know that I am new to EXTJS and I am not familiar with copying to clipboard.

But when googled it, it mentioned that you need flash. I don't think our application uses it.
So can you please elaborate how to implement it?

Gary Schlosberg
9 Jun 2014, 7:09 AM
I believe that coping to the clipboard is not permitted by browsers because of security concerns, so ExtJS does not have a method to do so. It seems that the Flash solution circumvents that based on user settings. Here's a few threads about it, including a link to a discussion containing more info.
http://www.sencha.com/forum/showthread.php?261423
http://www.sencha.com/forum/showthread.php?266327

twinkleni
9 Jun 2014, 7:19 AM
Thanks for replying. So do you have any other idea on how to copy paste values from two fields at once?

twinkleni
9 Jun 2014, 8:26 AM
I got it working. Thank you guys.