Loading...

options for Calculated Values in qListView fields

options for Calculated Values in qListView fields

  • This topic is empty.
Viewing 4 reply threads
  • Author
    Posts
    • #4998
      Anonymous
      Anonymous
      Participant

      Hi Kim,

         You need a javascript function that would get the first xxx chars from a field (see function DisplayChars below).

      Feel free to improve/extend the function.

      Then please place this function on a javascript file that is included in your page.

      Then you create a calculated field on the qListView using ezEdit option and in the Calculated Value enter the following

      <script> DisplayChars('<%FirstName%>',100);</script>.

      This would do the work for you. Please see the screenshot/.

      Any questions, please let me know.

      If you consider that this answers your question please mark it so.

      Thanks,

      function DisplayChars(str, charNumber)

      {

        if (charNumber < 0)

        {

          charNumber = 0;

        }

        var displayedStatus = str;

        if (typeof(displayedStatus) != 'undefined' && displayedStatus != null && displayedStatus.length > charNumber)

        {

          displayedStatus = str.substr(0, charNumber);

        }

        return displayedStatus;

      }

      CommunityJSfile.png

    • #6777
      Anonymous
      Anonymous
      Participant

      hi ,

      This solution is what I was looking for – display first few characters of my multiline text field.I added javascript to the page through CEWP on the page, but then in my qlistview it displays nothing. I checked source of the page – Javascript function is added correctly. Any idea what might be missing – using QuickApps 6.2 version. thanks.

    • #4134
      Anonymous
      Anonymous
      Participant

      What options are there for using calculated values in qListView fields?  The only examples I see are to concatenate two columns or use a javascript (with if, then statements). 

      Is there a reference document that shows the various syntax?

      Specifically I am trying to shorten the display of a multi-line of text field to the first 100 characters. 

      Thanks.

    • #6780
      Anonymous
      Anonymous
      Participant

      Javascript function has been working correctly, returns correct value. Just the custom column was showing blank. I looked up another post on related topic, disabled Ajax and that did the trick. But then it returns blank when I try to make it hyperlink – specify value in "Link To" field (opening in current window).

    • #6779
      Anonymous
      Anonymous
      Participant

      It could be that there is an error in the js function and that causes the column to display nothing.

      Can you debug the code and see what happens in the js function?

Viewing 4 reply threads

You must be logged in to reply to this topic.