Hello,
I try to build my first Custom View, and I meet some issues.
I use the extension Project Management and would like to add a custom view to entity Project.
I made 4 files :
- custom/Espo/Custom/Resources/metadata/clientDefs/Project.json
- client/custom/src/views/project/list-with-hello.js
- custom/Espo/Custom/Resources/metadata/app/routes.json
- client/custom/src/controllers/project/list-with-hello.js
The method I try to use is:
- define a view in clientDefs
- make a route for this view
- make a button to access to this view
At the moment, the button give me link that return 404.
I'm not sure to understand exactly is the issue, but I think the view is not reconized as it should.
Any advice would be much appreciated !
custom/Espo/Custom/Resources/metadata/clientDefs/Project.json :
client/custom/src/views/project/list-with-hello.js:
custom/Espo/Custom/Resources/metadata/app/routes.json:
client/custom/src/controllers/project/list-with-hello.jsââ
â
I try to build my first Custom View, and I meet some issues.
I use the extension Project Management and would like to add a custom view to entity Project.
I made 4 files :
- custom/Espo/Custom/Resources/metadata/clientDefs/Project.json
- client/custom/src/views/project/list-with-hello.js
- custom/Espo/Custom/Resources/metadata/app/routes.json
- client/custom/src/controllers/project/list-with-hello.js
The method I try to use is:
- define a view in clientDefs
- make a route for this view
- make a button to access to this view
At the moment, the button give me link that return 404.
I'm not sure to understand exactly is the issue, but I think the view is not reconized as it should.
Any advice would be much appreciated !
custom/Espo/Custom/Resources/metadata/clientDefs/Project.json :
Code:
{
"kanbanViewMode": true,
"color": null,
"iconClass": "fas fa-list-alt",
"relationshipPanels": {
"typeProjets": {
"layout": null,
"selectPrimaryFilterName": null
}
},
"views": {
"listWithHello": "custom:views/project/list-with-hello"
},
"menu": {
"list": {
"buttons": [
{
"label": "Vue ListWithHello",
"link": "#Project/list-with-hello",
"acl": "read"
}
]
}
}
}
Code:
define('custom:views/project/list-with-hello', ['view'], (View) => {
return class extends View {
template() {
return `
<div>
<div style="width: 50%; float: left; border-right: 1px solid #ccc;">
<h3>Liste des projets</h3>
</div>
<div style="width: 50%; float: left;">
<h1>Hello</h1>
</div>
</div>
`;
}
};
});
custom/Espo/Custom/Resources/metadata/app/routes.json:
Code:
{
"listWithHello": {
"path": "#Project/list-with-hello",
"controller": "controllers/project/list-with-hello"
}
}
client/custom/src/controllers/project/list-with-hello.jsââ
Code:
define('custom:controllers/project/list-with-hello', ['controller'], (Controller) => {
return class extends Controller {
run() {
this.main('custom:views/project/list-with-hello');
}
};
});
â

Comment