Hello all;
I want to add css file in my custom doctype, how?
I have a doctype name Project Manager Ticket i want to add css file in Trello Board
frappe.require([
"assets/<custom_app_name>/css/project_manager_ticket.css",
]);
This my folder directory in my code:-
<custom_app_name>/public/css/project_manager_ticket.css
Note:- You may use this css file through assets folder. In side the sites folder
This is one more was to add css in your doctype field using jquerry
For read-only type of field it won’t work
frappe.ui.form.on('<doctype_name>', {
refresh : function(frm){
set_css(frm);
}
});
funtion set_css(frm){
document.querySelectorAll("[data-fieldname='<field_name>']")[1].style.color = 'green'
document.querySelectorAll("[data-fieldname='<field_name>']")[1].style.fontWeight = 'bold'
document.querySelectorAll("[data-fieldname='<field_name>']")[1].style.color = 'red'
document.querySelectorAll("[data-fieldname='<field_name>']")[1].style.fontWeight = 'bold'
}
example:
i have doctype name = Trello and i have to change the status field color
frappe.ui.form.on('Trello', {
refresh : function(frm){
set_css(frm);
}
});
funtion set_css(frm){
document.querySelectorAll("[data-fieldname='status']")[1].style.color = 'green'
document.querySelectorAll("[data-fieldname='status']")[1].style.fontWeight = 'bold'
}```
5 Likes
Foram
3
Hello,
How to implement any loop in css query.
I am fetching the json data so it looks like this.
So if I want to fetch specific data in the left-right format so is it possible?
Thanks in advance