Add custom text color to field

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • swati
    replied
    Thanks you so much for this solution. I also want to ask one more thing when i select any record from Floor entity (it's a custom entity), it is always select it's id. i want to select it's office number.
    Can you please help me out.
    Attached Files

    Leave a comment:


  • telecastg
    replied
    In order to make your customization "upgrade safe" you need to:

    copy the code from client/res/templates/list.tpl to a custom template "client/custom/res/templates/list.tpl"
    insert a div tag with your text inside it above the line <div class="list-container">{{{list}}}</div>

    copy the code from client/src/views/list.js to a custom view "client/custom/src/views/list.js"
    modify the line template: 'list' with "template: 'custom:list'" to call the above custom template

    specify your custom view at the parent entity's ("Floor") clientDefs as:
    "views": {
    "list": "custom:views/list",
    "detail": "custom:views/generic/detail/header/close"
    },

    Leave a comment:


  • swati
    replied
    Hi
    I am working on espocrm.
    can anyone please tell me that how can i add text here ?
    I want to show a message when there is some data only on this page.
    Attached Files
    Last edited by swati; 05-20-2019, 10:09 AM.

    Leave a comment:


  • yuri
    replied
    In 5.5.3 it's possible to display enum fields as labels (a new field parameter).

    Leave a comment:


  • peterberlin
    replied
    The different colours are not easy to distinguish for people with glasses. The lines of the font are too narrow.
    of an alternative :

    Leave a comment:


  • tanya
    replied
    In the newest version you can set option color in Entity Manager

    Leave a comment:


  • Anatoleq
    commented on 's reply
    Hi Tanya, Fixed Lead.json by removing "[option]", but still no colors applied. Using it not as link. Json is valid btw.

  • tanya
    replied
    No, you can change entityDefs in custom, but you use the default view of this field, This view does not support style definition in entityDefs
    Read this article https://www.espocrm.com/documentatio.../custom-views/ Field View

    Leave a comment:


  • rodrigocoelho
    replied
    Originally posted by tanya
    this field has own view, with own hardcoded style


    you need to use own view for this field
    Hi Tanya, I didn't understand. I can't use custom json? What do you mean?
    ​​​​​​Thanks

    Leave a comment:


  • tanya
    replied
    this field has own view, with own hardcoded style


    you need to use own view for this field

    Leave a comment:


  • rodrigocoelho
    replied
    Originally posted by tanya
    example https://github.com/espocrm/espocrm/b...s/Task.json#L8
    1. "[option]" - you don't have this option in "options", why did you add it?
    2. after fixing check, if json is valid.
    3. Administration > Clear Cache > Refresh the page
    4. It won't work if you use it as link, but you can fix it
    EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.

    https://github.com/espocrm/espocrm/b.../list-link.tpl
    I'm editing the custom json on /custom/Espo/Custom/Resources/metadata/entityDefs/, as bellow (marked the added lines), but it is not working. Help me please!!!

    {
    "fields": {
    "stage": {
    "type": "enum",
    "options": [
    "Prospecting",
    "Value Proposition",
    "Id. Decision Makers",
    "Negotiation/Review",
    "Ganho sem arquivar",
    "Closed Won",
    "Encaminhado para Parceiros",
    "Closed Lost"
    ],
    "view": "crm:views/opportunity/fields/stage",
    "default": "Prospecting",
    "audited": true,
    >> "style": {
    >> "Ganho sem arquivar": "success"
    >> },

    "required": false,
    "isSorted": false,
    "probabilityMap": {
    "Prospecting": 10,
    "Value Proposition": 30,
    "Id. Decision Makers": 70,
    "Negotiation/Review": 0,
    "Ganho sem arquivar": 100,
    "Closed Won": 100,
    "Encaminhado para Parceiros": 0,
    "Closed Lost": 0
    },
    "fieldManagerAdditionalParamList": [
    {
    "name": "probabilityMap",
    "view": "crm:views/opportunity/admin/field-manager/fields/probability-map"
    }
    ],
    "readOnly": false,
    "tooltip": false
    },

    Leave a comment:


  • tanya
    replied
    example https://github.com/espocrm/espocrm/b...s/Task.json#L8
    1. "[option]" - you don't have this option in "options", why did you add it?
    2. after fixing check, if json is valid.
    3. Administration > Clear Cache > Refresh the page
    4. It won't work if you use it as link, but you can fix it
    EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.

    Leave a comment:


  • Anatoleq
    replied
    Tried to apply colors to Lead, but without a success. Code from custom\Espo\Custom\Resources\metadata\entityDefs\L ead.json below:
    "status": {
    "type": "enum",
    "options": [
    "",
    "Payment",
    "Admission",
    "Visa",
    "Start",
    "Paused",
    "Commission claim",
    "Visa refusal",
    "Cancel",
    "Follow up"
    ],
    "default": "Payment",
    "view": "views/fields/enum-styled",
    "style": {
    "Payment": "success",
    "Commission claim": "danger",
    "Follow up": "danger",
    "[option]": "[style]"
    },
    "required": true,
    "isPersonalData": false,
    "isSorted": false,
    "readOnly": false,
    "tooltip": false
    },
    Also in case field is marked as "link" in Layout manager - will it work also? I suspect that I need to change code somewhere else)

    Leave a comment:


  • tanya
    replied
    Originally posted by tanya
    Hi

    from enum-styled detail tpl
    Code:
    <span class="text-{{style}}">{{translateOption value scope=scope field=name}}</span>
    You can set any additional class after space, for example
    Code:
    "style": {
    "Completed": "success bg-danger"
    }
    if you write "bg-info" the class will be class="text-bg-info", if you use "success bg-info", you will have "text-success bg-info",
    try "default bg-info"

    Leave a comment:


  • pmontanez
    replied
    Hey tanya I'm trying to change bg color for opportunity -> stages, but it seems like it uses his own custom view- Here is the code that I'm using :

    "view": "views/fields/enum-styled",
    "style": {
    "Negotiation/Review": "bg-success",
    "Prospecting": "bg-info"
    },

    I also check this file client/modules/crm/src/views/opportunity/fields/stage.js but not sure if I can add the styles here to make it work.

    any Tip will be appreciated - Thanks,

    Leave a comment:

Working...