- This topic is empty.
- AuthorPosts
-
- 08/16/2011 at 6:55 am #4998
AnonymousParticipantHi 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;
}
- 01/08/2014 at 7:01 am #6777
AnonymousParticipanthi ,
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.
- 01/09/2014 at 9:41 am #4134
AnonymousParticipantWhat 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.
- 01/09/2014 at 9:41 am #6780
AnonymousParticipantJavascript 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).
- 01/09/2014 at 9:43 am #6779
AnonymousParticipantIt 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?
-
- AuthorPosts
You must be logged in to reply to this topic.