Home › Forums › Classic DFFS › Calculated column in Display Form
Tagged: calculated column date format
- This topic has 4 replies, 2 voices, and was last updated 6 years, 11 months ago by Paul Lynch.
-
AuthorPosts
-
-
January 16, 2018 at 16:51 #19344
If I add a calculated column as a field in a tab – it does not show up in my Display Form.
I can use some JS to create a HTML Heading item and then it shows up in display form, but the formatting looks a bit odd (the rest of the fields have a question field and response field).
Is there any reason why it by default does not show up?
-
January 17, 2018 at 00:18 #19348
I need to see a screenshot of your config and how it looks in the form.
Alexander
-
January 17, 2018 at 11:59 #19351
Thanks Alex. There are three dates, I just want to show these dates in a display form in a “friendly” format of dd.MMM.yyyy so want to show a calculated column instead of the original field.
PIC 1 – Shows the configuration in form:
1) Original Field
2) Calculated Column (that never shows up)
3) Is HTML in a field column I am trying to use to force it to show up!PIC 2 – Shows some columns – really just to confirm that the calculated column itself works great.
PIC 3 – Shows the Display Form – notice no calculated column is shown.
I create a HTML field workaround which shows up for one of the dates – “1.15 Start date of the OSQMV:” but not for the others?
PIC 4 – JS of HTML field workaround – first field is ok – but if I just copy line [39] to line [40] and update the reference it doesnt work – keep getting error 80020101 wondering how to add this in, as this might be easier than trying to solve why my calculated column is not showing.
Attachments:
-
January 18, 2018 at 19:19 #19369
I’m not sure I understand. In DispForm you should be able to show the calculated field straight forward in the tab – no need to use script.
Also, I haven’t actually tested out using style tags directly in the “Text or HTML” textarea – this code used here should be more plain HTML and you should use Custom CSS to keep all CSS classes. Maybe this code is the reason for the fields not showing properly?
Alexander
-
January 18, 2018 at 21:30 #19373
Thanks for looking Alex – still no idea why it’s not showing in display form.
However I finally got the html/js call to bring them in with your code posted elsewhere here so I am good now thanks.
If anyone else is looking to show 3 calculated columns in Editform. (or has issue showing in Display form see below – my internal fieldname and column names are the same btw)
var qRes = spjs.utility.getItemByID( { "listName":_spPageContextInfo.pageListId, "id":spjs.dffs.data.thisItemID, "viewFields":["calccoldate1","calcoldate2","calccoldate3"] } ); $("span.calccoldate1").html(qRes["calccoldate1"].split(";#")[1]); $("span.calcoldate2").html(qRes["calcoldate2"].split(";#")[1]); $("span.calccoldate3").html(qRes["calccoldate3"].split(";#")[1]);
Then in the HTML field added to tab (repeated for each column):
<table style="width: 100%" class="customised1"> <tr> <td class="customisedcss2" style="font-size:10.0pt;font-family:"Segoe UI Semilight",sans-serif; mso-fareast-font-family:"Times New Roman";color:#262626;mso-ansi-language:EN-GB; mso-fareast-language:EN-GB; width: 87%;">text for the column label </td> <td class="customisedcss3"><span class="calcoldatecss2" /></td>
-
-
AuthorPosts
- You must be logged in to reply to this topic.