clientNavbar extra item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kharg
    Senior Member
    • Jun 2021
    • 453

    clientNavbar extra item

    Following https://docs.espocrm.com/development...client-navbar/ I am trying to add a extra navbar item but my icon always end up on the left side of the search bar instead of being with all the other icons on the right side.

    I'd like to understand what I am doing wrong.

    Is the icon supposed to be on the left of the search bar?

    Click image for larger version

Name:	image.png
Views:	213
Size:	7.3 KB
ID:	114041

    Sample code:

    clientNavbar.json

    PHP Code:
    {
        
    "items": {
            
    "custom": {
                
    "view""custom-nav:views/site/navbar/custom-panel",
                
    "class""dropdown hidden-xs custom-container",
                
    "order"2
            
    }
        }
    }
    ​ 
    custom-panel.js
    PHP Code:
    define('custom-nav:views/site/navbar/custom-panel', ['view'], (Dep) => {
        return class extends 
    Dep {
            
    templateContent = `
            <a
                id="custom-dropdown"
                class="dropdown-toggle"
                data-toggle="dropdown"
                role="button"
                tabindex="0"
                title="{{translate 'Custom' category="scopeNamesPlural"}}"
            ><i class="fas fa-history icon"></i></a>
            <ul class="dropdown-menu" role="menu" aria-labelledby="custom-dropdown">
                <li class="dropdown-header">{{translate 'Custom' category="scopeNamesPlural"}}
                </li>
                {{#each customList}}
                    <li>
                        <a href="#{{./targetType}}/view/{{./targetId}}">
                            <span class="icon-container">{{{./icon}}}</span>
                            {{./targetName}}
                        </a>
                    </li>
                {{/each}}
            </ul>
        
    `
            
    data() {
                return {
                    
    customListthis.customList.map(item => {
                        return {
                            ...
    item,
                            
    iconthis.getHelper().getScopeColorIconHtml(item.targetType)
                        };
                    }),
                };
            }
            
    setup() {
                
    this.customList= [];
                
    Espo.Ajax.getRequest('Custom', {maxSize10})
                    .
    then(response => {
                        
    this.customListresponse.list || [];
                        
    this.reRender();
                    });
            }
            
    isAvailable() {
                return 
    true;
            }
        };
    });
    ​ 
  • Kharg
    Senior Member
    • Jun 2021
    • 453

    #2
    Fixed, the issue was the order in clientNavbar.json

    Because Global Search is an item itself and has order 5, as such anything greater than 5 should be fine to display the item on the right side.
    Last edited by Kharg; 01-21-2025, 12:48 AM.

    Comment

    Working...