Pergunta

I am looking to change how the display form looks. I have been searching for hours and don't know if what I am trying to accomplish is possible.

When I have a choice field with check boxes it displays them as Item1 , Item 2, Item 4, item 5.

I want to change the display view to look like the edit view with out having the rights to change it as seen here.
enter image description here

Foi útil?

Solução

If you don't already know about JSLink in SP2013, have a look at some examples here.

JS Link allows you to override the way data is rendered on various forms - viz. new, edit, view. In your case, new and edit forms are already behaving the way you want, but you need to override the view form for given field.

So you can choose to override your checkbox field, and instead of returning the comma-separated values, return something like this, (pseudocode alert)

    var selectedValues = commaSeparatedString.Split(',')
    // Get all choices on the field, say variable "allChoices".
    // I don't know how to get the choices dynamically, but you could *hardcode* if they are meant to be static over time.

    // Get the checked values first.
    foreach(choice in allChoices)
    {
        if(selectedValues.HasTheField(choice))
        {
             returnString += "<input type="checkbox" checked disabled>" + choice + "<br />";
        }
        else
        {
             returnString += "<input type="checkbox" disabled>" + choice + "<br />";
        }
    }

    function HasTheField ...
Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top