Editing document list results

You can change templates and manipulate data by capturing the jQuery events on the list. This way you can change the look of results while preserving the features in current HTML.

  • GUI_DLVOnStarting  : The event that is triggered before the document list request.
  • GUI_DLVOnStartRender : The event that is triggered after receiving the document list.
  • GUI_DLVOnEndRender : The event that is triggered after all operations are completed.

You can change the Template over the object that is passed as a parameter to the events. You can add 'Cancel=true' value to the object to make it stop the process and take control of every event related to it. Resulting in template documents can be checked for editing templates. Click here for sample HTML that you can prepare templates with.

(warning)  Documents can be listed in more than one place in the interface. Question results are displayed on the main screen and similar copy documents are shown on the right when the document is clicked, both use the same event. args.Options.RenderSub value passed as true for the fields on the right. The args.targetDom value for the region to be customized can also be checked if needed.

<script>
$(document.body).on("GUI_DLVOnStartRender",function(e,args) {
	if(!args.Options.RenderSub)  //RenderSub value is set true for special list fields such as similar documents.
	{
		args.Template="<d:r data='data'><div>{{ data.DisplayName }} </div></d:r>";
	}
})
</script>


You can change the TemplateSelector value so that different templates are used for each data.
<script type="dece-template" id=myTemplate>
	<div class="list-item pnl-query-item IsDoc DocALL docOpenLinkRoot DocArea" style="padding:5px !important">
		<h4>{{ data.DisplayName }} </h4>
		<hr>
		<a href="{{data.GetHref()}}" target="_blank">
				<img src="{{context.ResolveUrl('~/GeodiJSONService?op=getContentThumbnail&ContentIdentifier=' + data.RedirId + '&wsName=' + HttpUtility.UrlEncode(context.Options.Query.wsName) + '&rnd=' + window.___DomStartDate, false) }}" border=0 title="{{data.DisplayName}}" />
		</a>
	</div>
</script>

<script>
$(document.body).on("GUI_DLVOnStartRender",function(e,args) {
	if(!args.Options.RenderSub)  //RenderSub value is set true for special list fields such as similar documents.
	{
		args.TemplateSelectorOriginal=args.TemplateSelector;
		args.TemplateSelector= function(data,context) {
				if(data.ContentType=="filecontent:.pdf")
					return $("#myTemplate");
				if(args.TemplateSelectorOriginal)
					return args.TemplateSelectorOriginal(data,context);
			}
	}
})
</script>