Hi,
I was wondering if is possible to change name of services on the left menu for locode.
These are two autoquery (QueryDb<>) services with different autofilter attributes, so i would like to show them with a different name.
Hi,
I was wondering if is possible to change name of services on the left menu for locode.
These are two autoquery (QueryDb<>) services with different autofilter attributes, so i would like to show them with a different name.
You could override the humanify()
function in /wwwroot/modules/locode/custom.js which is used to render the table name, here’s the default impl:
function humanify(s) {
return !s || s.indexOf(' ') >= 0 ? s : ucFirst(splitTitleCase(s).join(' '))
}
But that’s not going to let you easily distinguish between the first and second API tables.
So you’ll likely need to override the built-in SidebarNav
component and provide a custom label()
function to return the preferred name for the operation:
<script>
App.components({
SidebarNav({ store, $on }) {
return {
$template: '#sidebar-nav-template',
store,
$on: $on || null,
label(op) { return humanify(op.dataModel.name) },
getIcon: Meta.getIcon,
}
},
})
</script>
You should be able to add this custom component in /wwwroot/modules/locode/components/SidebarNav.html
.
Thanks i will give it a try