vLookup Multiline Text Column with "read more"

Home Forums vLooup for SharePoint vLookup Multiline Text Column with "read more"

Viewing 2 reply threads
  • Author
    Posts
    • #27108

      Hi Alexander,

      Is it possible to limit a multiline text column to – for example – 2 lines and have a “read more” link after the 2 lines to show the full text like in an accordion ?

      Thank you very much in advance.

      BR,
      Chris

    • #27112
      Alexander Bautz
      Keymaster

        Add this you the Special configuration textarea for the multiline text field in the vLookup config (in the ViewFields section):

        {"function":"readMore"}

        Then add this to your Custom JS (in all forms and also in the list view if you use vLookup in a list view):

        function readMore(val, item) {
            var v = val;
            if (val.length > 100) {
                var trunc = val.substring(0, 100);
                v = "<span style='cursor:pointer;' onclick='jQuery(this).hide().next().show()'>" + trunc + "...</span><span style='display:none;'>" + val + "</span>";
            }
            return v;
        }

        Please note that this will only work for a plain text multiline and not rich text (because the substring will break the HTML of the field value).

        Alexander

      • #27150

        Hi Alexander,

        Thank you very much this worked like a charm.

        BR,
        Chris

    Viewing 2 reply threads
    • You must be logged in to reply to this topic.