Hello , I have created a Doctype named Request I have a select field in it having 4 values A , B , C , D
I want them to be displayed in color in list view .
Please Can Any One Tell Me How Can I do So
@nilpatel42 Thanks For your response
I implemented the changes as per your suggestion
but it is still not showing color in the list view
@dhruv_vaswani try to use formatter : create a client script type list :
frappe.listview_settings['Request'] = {
formatters: {
response_status(val) {
if (val=="A"){
return "<span class='indicator-pill green'>"+__(val)+"</span>"
}else{
return "<span class='indicator-pill red'>"+__(val)+"</span>"
}
}
}
}
8 Likes
can we set the above code to display red if the number is negative & green if number is positive?
Rgds
Frz
If you are doing it for a select field then simply select the option in the if statement and give it a color
and if there is more then one negative value you can also use the “else if” statement for it
Hope this is helpfull
Thank you