Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a requirement to copy and paste only the properties of a document library item. There must be two button on the Edit-Form.aspx ribbon that allows me to copy and paste only the properties. I know this can be achieved by creating and deploying a custom feature with Visual Studio 2010. What ecma or java script should I call to achieve this functionality in the code.

Example:<CommandUIHandler Command="Copy" CommandAction="javascript: ?????"/>

Thanks & Best Regards

share|improve this question
    
Do you intend to paste properties to existing items in the same document library? –  Andrey Markeev May 28 '12 at 5:27
    
Yes, Andrey u r right –  Zakir HC May 28 '12 at 7:32
add comment

1 Answer 1

In Copy action, you should retrieve list item values and save them somewhere. Clipboard is not a good choice here, because some browsers don't accept direct access to the clipboard. Thus, I can propose HTML5 local storage, which is at the moment supported by all the modern browsers.

You can find details on HTML5 local storage here:

For retrieving data from a list item, use JavaScript Client Object Model, as it described in the following MSDN article:

In Paste action, you should edit existing item and pass the stored in the local storage values. You can find guidance for updating a list item in the following MSDN article:

share|improve this answer
    
Thanks for the reply. I will implement the solution and let u know –  Zakir HC May 28 '12 at 12:45
    
You're welcome! And please, don't hesitate to ask additional questions, if any. The question is actually quite interesting for me. –  Andrey Markeev May 28 '12 at 18:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.