SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to have a button inside a column in Sharepoint list.

For Example:

We have a column as ID - number, Name - Single line text box, Status - Approve as button so that user will click Approve and will update the Field value in the list and submits the record.

Is it is feasible in Sharepoint.

share|improve this question
2  
May I know, which version of SharePoint you are using? – Shantha Kumar Thambidurai Jan 7 at 14:01
    
SharePoint 2010 – Bagavathi Jan 8 at 4:34
up vote 12 down vote accepted

If you are using SharePoint 2013 or SharePoint Online, you can take advantage of JSLink to render your Status field as you want - in this case a button with some javascript logic behind it.

The process would be very similar to the one described here: http://sharepoint-community.net/profiles/blogs/using-jslink-to-implement-delete-buttons-for-list-view.

I'm assuming here that by "submits the record" you are referring to something that can be achieved by javascript

share|improve this answer

Read the Pros & Cons at : http://www.viewmaster365.com/#/How

  • Create a Calculated Column View

  • set Datatype=Number (will output String as HTML)

  • Add the Formula:

    ="<a href='#' onclick=""{event.stopPropagation();"
    &"var ID=getItemIDFromIID(findIIDInAncestorNode(this)),"
    &"url=_spPageContextInfo.serverRequestPath.replace(/[^\/]*$/gi,'');"
    &"this.parentNode.innerHTML='Opening:'+ID;"
    &"document.location=url+'DispForm.aspx?ID='+ID;"
    &"}""><img src='/_layouts/images/VIEWREPORTSHH.png' width='20px'></a>"
    

Onclick it captures the ID value from the TR node
Builts the correct url
Displays a message (every click in a webpage should give an immediate response IMHO)
goes to the url

I am not 100% sure if those IID functions exist in 2010, if not see the examples below for alternative code

More:

ICC

share|improve this answer

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.