게시 웹 사이트에 SharePoint 조회 필드를 표시합니다
-
10-07-2019 - |
문제
Moss Publishing 웹 사이트의 페이지에는 조회장 인 속성이 있습니다.
편집 모드가 아닌 페이지를 볼 때 선택한 텍스트 만 표시되기를 원하지만 Microsoft.SharePoint.WebControls.LookupField
SharePoint 목록 항목에 하이퍼 링크를 생성합니다 (분명히 나쁘다).
내 조회 필드 컨트롤을 만들지 못하는 방법이 있습니까?
해결책
jQuery 해킹을 사용할 수 있습니다
jQuery를 사용하여 링크 된 목록 항목 하이퍼 링크를 제거합니다.
<script type="text/javascript" src="/jquery-1.3.1.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('a[href*="RootFolder=*"]').each(
function(index) {
var link = $(this);
$(this).after("<span>" + link.text() + "</span>");
$(this).remove();
});
});
</script>
다른 팁
나는 또한이 문제를 해결했다. 내가 찾은 유일한 방법은 내 자신의 제어를 만드는 것이 었습니다.
링크를 제거하기 위해;
아래와 같이 displayTemplate.ascx를 만들 수 있습니다
SharePoint : renderingtemplate id = "lookupdisplaytemplate"runat = "server"> & blockquote & template> & blockquote & sharepoint : fieldValue id = "fieldValue1"runat = "Server"ControlMode = "display"/> & blockquote &//template> & blockquote &//sharepoint : rendertemplate
그 다음에. 아래와 같이 사용하십시오.
& blockquote & sharepoint : lookupfield id = "lookupfield1"FieldName = ""runat = "Server"displayTemPlateName = "XookUpDisplayTemplate"/>
그런 다음 작동합니다.
도움이되기를 바랍니다 :)
Sebnem