Alfresco Dashlet Resizer

I’m working on a product based on Alfresco Community Edition, the opensource document management platform. We’re using Alfresco Share aplication as a frontend. I’m doing a lot of customizations on it, some in forms of new Share dashlets.

One of the things that has been bugging me is how to make dashlets resizeable. So, for others still possibly looking for this issue, I’m posting the answer here.

To make a dashlet resizeable, you need to two bits of code in your dashlet.get.html.ftl:

1. Add this piece of JavaScript to instantiate the Resizer object:

[code lang="html"]<script type="text/javascript">//<![CDATA[

new Alfresco.widget.DashletResizer("${args.htmlid}", "${instance.object.id}");

//]]></script>[/code]

2. Your dashlet needs a div with a class of “body”.

Make it look for dashlet height:

[code lang="freemarker"]<div class="body scrollableList" <#if args.height??>style="height: ${args.height}px;"</#if>>[/code]

Leave a Reply