AnsweredAssumed Answered

Adding more document actions to Data Lists in 4.1.3

Question asked by bengrah on May 5, 2015
<strong>This is for Alfresco EE 4.1.3</strong>

I'm currently filling a requirement to add a custom action for data list items. Out of the box, you get three actions (permissions dependant): Edit, Duplicate and Delete. I'm wanting to add a fourth called 'Add To Calendar' which when clicked, will add the list item in some form to the site calendar.

The document actions for data list items are defined in the file <em>datagrid.get.config.xml</em>, contents as follows (with my new action added):


<dataGrid>
   <actionSet>
      <action type="action-link" id="onActionEdit" permission="edit" label="actions.edit" />
      <action type="action-link" id="onActionDuplicate" permission="create" label="actions.duplicate-row" />
      <action type="action-link" id="onActionDelete" permission="delete" label="actions.delete-row" />
      <action type="action-link" id="onActionAddToCalendar" permission="edit" label="actions.add-to-calendar" />
   </actionSet>
</dataGrid>


When I add an extra action to this file and restart Alfresco, I can see now on the data lists Actions column, there is now a More… + button ala document library, since there is more than 3 actions there is now an overflow (again as per document library). My issue is that clicking on the More… + button at this point doesn't actually do anything; clicking should bring up a small list of extra actions, but nothing happens.

If I remove / comment out one of the above actions, that works <em>in a way</em> - the amount of actions are reduced to 3 and the More… overflow is not used. But obviously that means I can only have 3 actions at one time and I don't want to reduce any of them since they are all used.

<strong>Possible solutions</strong>

So there are a couple of things I can think of to resolve this:

<ul>
<li>either lift/try to lift/hack the script that is used to display the More… + button on the document library from <em>documentlist.js</em> (sounds easy(!)) and use it in the datalist page</li>
<li>change the maximum amount of document / data list actions that can be displayed before the More… + overflow (default is 3, raise it to 4.)
</ul>

Any guidance here would be really appreciated.

Thanks,
bengrah.

Outcomes