Skip to main content

I have a template field in a table that displays 3 fields with some HTML. Can I limit the maximum number of characters displayed ?

it can be done with javascript. see the following link for an example of how it can be done: http://www.yourinspirationweb.com/en/jquery-tips-tricks-how-to-limit-characters-inside-a-textarea/


Hi Raymond -

You could likely create a UI Only Formula field and incorporate the use of the LEFT formula function.  I’ve never actually tried using a formula field to emit HTML itself so I’m not sure if it will play nicely but theoretically it should work and save you from having to write the javascript.  If it doesn’t work, besides letting Skuid know about it, you could possibly have 3 formula fields that all use LEFT.  The latter option has a shortcoming since you likely really want as much as possible from all three 3 fields chopping off only the last field but possibly it would work for you.

Hope this helps!


Thanks guys. The UI field and the Salesforce field ideas are a no-go. I found this plug in which seems to do what I want, but I have no idea of how I would get it to run with Skuid. If I wanted to run something like this, what would the basic steps be to make it a field renderer? http://www.aakashweb.com/jquery-plugins/collapser/


Wow, seems I completely misunderstood what you were looking for. sorry about that.

to create a custom renderer you can create an in-line snippet, I assume you want to modify the renderer for “READ” but not for “EDIT” mode, based on this here’s a sample renderer:


var field = arguments 0], value = arguments 1];<br>skuid.ui.fieldRenderersdfield.metadata.displaytype]sfield.mode](field,value);<br>if (field.mode === "read")<br>{<br>&nbsp; &nbsp; //add code here to modify the display. - specifically you'd want to deal wtih "field.element"<br>&nbsp; &nbsp; //something along the lines of:<br>&nbsp; &nbsp; field.element.collapser({mode: 'words', truncate: 20&nbsp;});<br>}





In addition to Mordechai’s sample code, you’ll also need to add a static resource to pull in the collapser code.  If you can find the collapser JS hosted on a CDN, you can just point to that URL.  If you’re unable to find it hosted anywhere, you’ll need to download the code itself and create a static resource in your org and then point to that.


You guys are awesome, thanks for the help. I will give this a whirl and see what I can pull off.