문제

I have a document library with a custom DispForm.aspx page. In this library, I have a column with the option Append Changes to Text. The DispForm.aspx displays the information correctly by this code

<SharePoint:AppendOnlyHistory runat="server" FieldName="..." ControlMode="Display" ItemId="{@ID}"/>

Is there a way to have the DispForm.aspx page show the items, but not display the modified date and user who modified it?

도움이 되었습니까?

해결책

The only way to do that would be to use javascript/jQuery. The code that you posted runs server side and you have no control over the output. You'll have to do some front-end manipulation after the page has been rendered. Hopefully, SharePoint gives you a good hook onto these elements, otherwise, it could be rather difficult.

Here's some jQuery to help you along:

// for the append-only comments, disable the click-to-view author and date

$("a[href*='_layouts/userdisp.aspx?ID=']").each(function(){ $(this).closest("span").replaceWith($(this).html()); }); $("a[href*='/Lists/MyListName/DispForm.aspx?ID=']").each(function(){ $(this).replaceWith($(this).html()); });

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top