Extra button link

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • yuri
    replied
    No ability. You will need to write action and js code.

    Leave a comment:


  • homeempire
    replied
    Thanks. Working great. But how open links in new card?

    Leave a comment:


  • yuri
    replied
    use this.menu.buttons

    Leave a comment:


  • homeempire
    replied
    Ok thanx it's working.

    But tell me please how to make directly button instead of dropdown action?
    I guess that i need to change this.menu.actions.push ? But for what?
    And how open links in new card instead the same window?
    Last edited by homeempire; 07-10-2015, 11:11 AM.

    Leave a comment:


  • yuri
    replied
    You should put that code into setup method. Take some of existing classes as an expample.

    Leave a comment:


  • homeempire
    replied
    Ok I have own class. I put detail.js in client/custom/src/views/account. My code:

    Code:
    Espo.define('Custom:Views.Account.Detail', 'Views.Detail', function (Dep) {
    
    return Dep.extend({
    
    relatedAttributeMap: {
    'contacts': {
    'billingAddressCity': 'addressCity',
    'billingAddressStreet': 'addressStreet',
    'billingAddressPostalCode': 'addressPostalCode',
    'billingAddressState': 'addressState',
    'billingAddressCountry': 'addressCountry',
    'id': 'accountId',
    'name': 'accountName'
    },
    },
    
    
    
    });
    });



    Can You give me a code ? I try with this but it doesn't work:

    Code:
    Espo.define('Custom:Views.Account.Detail', 'Views.Detail', function (Dep) {
    
    return Dep.extend({
    
    relatedAttributeMap: {
    'contacts': {
    'billingAddressCity': 'addressCity',
    'billingAddressStreet': 'addressStreet',
    'billingAddressPostalCode': 'addressPostalCode',
    'billingAddressState': 'addressState',
    'billingAddressCountry': 'addressCountry',
    'id': 'accountId',
    'name': 'accountName'
    },
    },
    
    this.menu.actions.push({
    'label': 'Zadzwoń',
    'link': 'tel: ' + this.model.get('name'),
    'acl': 'read'
    });
    
    });
    });

    Leave a comment:


  • yuri
    replied
    You can't do this via clientDefs. You will need to create own class for detail view (Custom:Account.Detail) and add your button dynamically with "link": 'tel: ' + this.model.get('youField') instead of "action"

    Leave a comment:


  • homeempire
    started a topic Extra button link

    Extra button link

    Hi.

    I add extra button to Account Entity. I add this code to clientDef:

    "menu": {
    "detail": {
    "buttons": [
    {
    "label": "Zadzwoń",
    "action": "zadzwon",
    "acl": "read",
    "style": "default"
    }
    ]
    }
    },

    and button is ok.

    but….

    My question is how to make button to link: "tel: {name}" ?
Working...