Hi All,
I'm trying to change row color of my list view (grid) by condition.
Any idea please?
Hi All,
I'm trying to change row color of my list view (grid) by condition.
Any idea please?
Hello Dallen.
I am looking to research and experiment with Scripts that would accomplish this on both CRM Views and CRM Dashboards. Have you been able to successfully implement this in Sandbox or Production? I would appreciate any help and direction on this.
Thank you and Best Regards,
Arslan
1. get rowid
2. get the row element
3. set the css
var str = JSON.parse(rowData);
var rowId = str.RowId;
$("div[row-id='"+rowId+"']").css("background-color","green");
$("div[row-id='"+rowId+"'] div span").css("color","white");
Hey Phuoc. I am interested in implementing this for our organization? just curious about how and why it is unsupported solution?
Regards, Arslan
thank you Samira,
but, when i implement your code the first choice disappeared from the list.
maybe here i have a problem in the name of 'tr'.
haw can i find it?
Check My JS below:
function showEventStatusNew(rowData, userLCID) {
debugger;
if (rowData == null || rowData == 'undefined') return;
// read rowdata
var str = JSON.parse(rowData);
var coldata = str.new_statoevento_Value;
var rowId = str.RowId;
var opened = str.new_opened_Value;
if (coldata == null || coldata == 'undefined' || coldata.length < 1) return;
if (!opened) {
switch (coldata) {
case 2:
$("tr[oid='" + rowId + "']").css('fontWeight', 'bold');
// $('span:contains("Attivo")').parent().parent().css('fontWeight', 'bold');
break;
case 0:
$("tr[oid='" + rowId + "']").css('fontWeight', 'bold');
break;
default:
break;
}
}
}
Hi,
This is not supported solution to change the row color in Grid.
try this solution: docs.microsoft.com/.../display-custom-icons-instead
I agree that this may work. However, this approach is not supported. Indeed, according to Microsoft, DOM manipulation is not supported.
Hi Mehdi,
the best solution is with Js.
@samira Mirza gave me an good link. but just i don't know how to find the 'td' in the JS proposed.
arpitmscrmhunt.blogspot.com/.../dynamics-crm-dynamically-change-row.html
Hi,
I don't think there is a supported way to implement your scenario. I suggest you look for or implement a PCF Control that meets your needs.
Another approach would be to use custom icons on one of the columns of your grid. Indeed, this approach is supported..you can find the details of the implementation here: docs.microsoft.com/.../display-custom-icons-instead
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156