1

I would like to get collection field value using CSR/JSLink.Below code is iterating value of the particular column.But,in my scenario i needed to get whole collection.

<script type="text/javascript">

    var arr = "";
    (function () {

            var overrideCtx = {};
            overrideCtx.Templates =  {};

            overrideCtx.Templates.Fields = {
                            'Title': { 'View' : CustomField }
         };

         SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);



    })();

    //alert(arr);

    function CustomField(ctx) {

        var currentValue=ctx.CurrentItem.Title;

        // arr+=currentValue;

        return currentValue;


    }

</script>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
  • You want get Field collection for particular list using jslink ? – Dipen Shah Dec 25 '15 at 12:14
  • 1
    Can you please clarify your needs? It is not clear right now – Robert Lindgren Dec 25 '15 at 14:16
1

All the fields are in an array of objects:

ctx.ListSchema.Field

All the rows are in

ctx.ListData.Row

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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