We have a form with a textarea field and a tableview with inline search for this form. As the content of the textarea field has to be searchable, we included it in the tableview. The length of the text increases the line height so that we would like to
- show only an excerpt in table view OR
- exclude this field from table view
but still the field content should be searchable in the view.
Is that even possible?
Yes, you can use trim/trunc or even truncWithExpand functions to limit the number of characters shown in the field
Shows first 100 symbols from a field "fieldname"
Please be careful when you truncating the field's value which may have HTML as it may produce a broken output (truncating HTML contents so that it becomes not valid)
You might need to consider using "extractText" first
I have just tried the function
in the Confiforms Field macro. But I am getting the below result on my page in the Table View:
st test test test st test test test test test st test test test test testst test test test test test <span id='sah7squ1lp' class='sah7squ1lp_c'><a href='#sah7squ1lp' onclick='cfExpandDetails("sah7squ1lp");return false;'>...</a></span><span class='sah7squ1lp_e' style='display:none'> st test test test st test test test test test st test test test test testst test test test test test </span>
Apparently, the code is inserted correctly, but the page doesn't compile it.
What could I be doing wrong?
Well, the function "truncWithExpand(N)" is really not something to use with an HTML contents, as it truncates the characters... and can potentially cut your HTML contents in a very bad way
You should probably use "extractText" on this field first and then truncate.
Also make sure, please that you are not on a ConfiForms version where we had a regression issue with escaping HTML contents (please always upgrade to latest version if possible)
I did try with "extractText" too. Unfortunately, I get the same result.
I started using ConfiForms about 2-3 weeks ago, so I guess the version must be pretty recent.
I also tried with ".renderAsHtml" at the end, but this didn't help either.
The field I am trying to truncate is a "Textarea."
Since our last roundup in April, Atlassian's Marketplace Partners have added over 100 new cloud apps to the Atlassian Marketplace to help your teams work more efficiently. Let’s take a quick look a...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events