Question

Customize task

Hello, community!

 

Is there any way that I can customize the appearance of the task? So, instead of it being with a single button - "completed" could I remove this "completed" button and add two more of my own? Something like this:

Like 0

Like

3 comments

Hi Nicolaiciuc Maria,



Do you want to customize this task in the dashboard?

i.e the tasks appear in the section dashboard area.



BR,

Bhoobalan Palanivelu.

Bhoobalan Palanivelu,

I am not sure what do you mean by dashboard. I want these buttons right in the section page of the record, where the tasks usually apear. I will attach a photo for you. Thank you!

Nicolaiciuc Maria,



Thanks for clarifying!

 

To change the view of the task (modify the buttons) in the action dashboard (the place where you want as attached in your screenshot) you can do the following: 

 

STEP 1: Create your own module extending "BaseDashboardItemViewConfig" and changing the Item view as you need. You can see how the fields are displayed in the getActionsViewConfig() method, which you would need to modify. 

define("UsrDashboardItemViewConfig", ["BaseDashboardItemViewConfig"], function() {
    Ext.define("Terrasoft.configuration.UsrDashboardItemViewConfig", {
        extend: "Terrasoft.BaseDashboardItemViewConfig",
        alternateClassName: "Terrasoft.UsrDashboardItemViewConfig",
 
        getActionsViewConfig: function() {
            return {
                "name": "Actions",
                "itemType": Terrasoft.ViewItemType.CONTAINER,
                "classes": {wrapClassName: ["dashboard-item-actions on-hover-visible"]},
                "items": [
                    {
                        "name": "NO",
                        "itemType": Terrasoft.ViewItemType.BUTTON,
                        "style": Terrasoft.controls.ButtonEnums.style.BLUE,
                        "caption": "No",
                        "click": {"bindTo": "onCancelButtonClick"},
                        "classes": {
                            "textClass": "dashboard-item-right"
                        },
                        "visible": {"bindTo": "CancelButtonVisible"}
                    },
                    {
                        "name": "YES",
                        "itemType": Terrasoft.ViewItemType.BUTTON,
                        "style": Terrasoft.controls.ButtonEnums.style.BLUE,
                        "caption": "Yes",
                        "click": {"bindTo": "onExecuteButtonClick"},
                        "classes": {
                            "textClass": "dashboard-item-right"
                        },
                        "visible": {"bindTo": "ExecuteButtonVisible"}
                    },
 
                ]
            };
        }
    });
});



STEP 2: Create a replacing SectionActionsDashboard schema and add your modules to the dependencies. 

 

define("SectionActionsDashboard", ["UsrDashboardItemViewConfig"], function() {
    return {
 
        methods: {
            initDashboardConfig: function() {
                this.callParent(arguments);
                const dashboardConfig = this.get("DashboardConfig");
                var activityItemsConfig = {
                    "Activity": {
                        viewModelClassName: "Terrasoft.ActivityDashboardItemViewModel",
                        viewConfigClassName: "Terrasoft.BaseDashboardItemViewConfig"
                    }
                };
                if (this.$entitySchemaName === "Case") {
                    activityItemsConfig.Activity.viewConfigClassName = "Terrasoft.UsrDashboardItemViewConfig";
                }
                Ext.merge(dashboardConfig, activityItemsConfig);
                this.set("DashboardConfig", dashboardConfig);
            }
        }
    };
});

 

 



BR,

Bhoobalan Palanivelu.

 

 

Show all comments