Share
Go down
avatar
Admin
Admin
Tổng số bài gửi : 389
Points : 704
Reputation : 0
Join date : 11/10/2018
https://thanthan.forumvi.com

Dynamically change row color in grid view Empty Dynamically change row color in grid view

on Wed Oct 17, 2018 8:27 am
Step 1: Create a web resource of JavaScript Type and paste the below code under Text Editor.

Code:
function highline(rowData) {
    var str = JSON.parse(rowData);
    var color = "";
    switch (str.statuscode) {
        case "status_a":
            color = "yellow";
            break;
        case "status_b":
            color = "LimeGreen";
            break;
        case "status_c":
            color = "Tomato";
            break;
        case "status_d":
            color = "SkyBlue";
            break;
        case "status_e":
            color = "Azure";
    }
    if (color != "") {
        var row = window.document.querySelectorAll('[oid="' + str.RowId + '"]');
        if (row != undefined)
            row[0].style.background = color;
    }
}

Dynamically change row color in grid view 321

Step 2: Open entity view and mention the web resource and function name. I have selected Status Reason field because we have to perform the logic based on Lead Status value.

Dynamically change row color in grid view 12

Dynamically change row color in grid view 32

Step 3: Save and Close the View. Publish the Entity to see the changes.

Dynamically change row color in grid view Capture
Về Đầu Trang
Permissions in this forum:
Bạn không có quyền trả lời bài viết