cancel
Showing results for 
Search instead for 
Did you mean: 

The link 'onActionView'does not work on the form 'dataGrid'

3snet
Champ in-the-making
Champ in-the-making
Hello everyone,

I currently work on customizing the module "DataList" and I want to change the "actionSet" located in the form "dataGrid" to display the action "View" in addition to actions by default: "Edit", "Delete" and "Duplicate".
To this I add the line "<action type="action-link" id="onActionView" permission="admin" label="actions.view" />" in file "datagrid.get.config.xml" .
Link added well as desired, but clicking on the link nothing happens.

Have you any idea why it does not work and if so thank you to tell me how and where to make the necessary changes.

Regards.
12 REPLIES 12

mikeh
Star Contributor
Star Contributor
What are you expecting that action to do? You'll have to provide the implementation for the "onActionView" method.

Thanks,
Mike

3snet
Champ in-the-making
Champ in-the-making
Hi Mike,

I hope that users who do not have editing rights can open the form in display mode and thus unable to make changes.

Knowing that I can not show all fields on the "datagrid" having regard to their large number.

Regards.

mikeh
Star Contributor
Star Contributor
The actions are automatically disabled if you do not have the rights to perform them.

Thanks,
Mike

3snet
Champ in-the-making
Champ in-the-making
Yes but my wish is to allow "Editor" users to create an item (pen button) and to allow "Reader" users to open the item to read it (dont make changes).

By default, a "Reader" user did not see any action and therefore can not open the form in order to view other fields that are not displayed in the "datagrid".

Thanks.

mikeh
Star Contributor
Star Contributor
Ah right, OK.

Then yes, you'll need to implement the function either by editing actions.js or by extension. Grab the first section of onActionEdit, but change the form mode to "view" - you might find it mostly works as-is without much extra work.

Thanks,
Mike

3snet
Champ in-the-making
Champ in-the-making
I do not find function "onActionEdit" in the file "C: \ Alfresco \ tomcat \ webapps \ share \ components \ data-lists \ actions.js"!
I did not find either in the file "C: \ Alfresco \ tomcat \ webapps \ share \ js \ actions.js-datalist".

Could you, please, tell me where to find this file.

Thanks.

mikeh
Star Contributor
Star Contributor
Sorry, it's in datagrid.js in the same folder.

Thanks,
Mike

3snet
Champ in-the-making
Champ in-the-making
Thank you Mike, I'll try to do that.
Should I also change the file "datagrid-min.js".
Besides, what's the connection between these two files?

Thanks.

mikeh
Star Contributor
Star Contributor
The -min.js file is a minimized version of the .js file. We use YUI Compressor in the build phase to generate them.

Thanks,
Mike