Colourful MSD View

color grid

Explanation:

  1. Create JavaScript library with below function code
  2.  Sample JavaScript Code
    function displayIconTooltip(rowData, userLCID) {
    
        var str = JSON.parse(rowData);
        var col_data = str.soft_fieldName_Value;
    
        var imgName = "";
        var tooltip = "{" + col_data + "}";
    
        switch (col_data) {
            case 1: //Fulfiled 
                imgName = "soft_Green";
                tooltip = "Fulfilled Completetly";
                $('span:contains("Fulfiled")').closest('tr').css('background-color', 'green');
                break;
            case 2: //Partial
                imgName = "soft_Yellow";
                tooltip = "Fulfilled Partialy";
                $('span:contains("Partial")').closest('tr').css('background-color', 'yellow');
                break;
            case 3: //Unfulfilled
                imgName = "No_colour";
                tooltip = "No fulfilled";
                $('span:contains("Unfulfilled")').closest('tr').css('background-color', 'white');
                break;
            case 4: // Cancelled 
                imgName = "soft_Red";
                tooltip = "Fulfilment Deactived/Cancelled";
                $('span:contains("Cancelled")').closest('tr').css('background-color', 'red');
                break;
    
            default:
                imgName = " ";
                tooltip = "N/A";
                break;
    
        }
        var resultarray = [imgName, tooltip];
        return resultarray;
    
    }
  3. then register that JavaScript on the view
  4.  Publish your changes  and hard refresh your browser
  5. … and done !!  🙂

Please note here is this will work only on Read Only View, not on the Editable View.

Thanks!

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s