I explained my problem with images.
In short, custom js scripts in reports or documents remain active in the workspace when you click the back button (or “e” logo). but when i refresh the page it is fixed. how can i fix this?
I explained my problem with images.
In short, custom js scripts in reports or documents remain active in the workspace when you click the back button (or “e” logo). but when i refresh the page it is fixed. how can i fix this?
Hii @NCP
my js code in the report;
$(".custom-actions.hidden-xs.hidden-md").hide();
$(".menu-btn-group").hide();
frappe.query_reports["Status of My Hourly Leaves Earned"] = {
"filters": [
],
"onload": function(report) {
$(document).ready(function() {
// Add content after the report title
var report_head = $(".page-head-content");
var info = $("<p style='color:#169754;'> <b>In accordance with the Human Resources Regulation, Leisure Leaves can be used 1 month after the leave is earned. </b></p>");
report_head.after(info);
});
frappe.after_ajax(function() {
$('.col-md-12 span').parent().parent().parent().hide();
});
setTimeout(function() {
$('.report-footer.text-muted').hide();
}, 1000);
},
};
Hmm, you are right @gelveri,
Please try it.
"onload": function (report) {
// Check if the content is already added to avoid duplication
if (!$(".custom-report-content").length) {
// Add content after the report title, inside a specific div with class "custom-report-content"
var report_head = $(".page-head-content");
var info = $("<div class='custom-report-content'><p style='color:#169754;'><b>In accordance with the Human Resources Regulation, Leisure Leaves can be used 1 month after the leave is earned.</b></p></div>");
report_head.after(info);
}
// Code to hide elements after the report is loaded
frappe.after_ajax(function () {
$('.col-md-12 span').parent().parent().parent().hide();
});
setTimeout(function () {
$('.report-footer.text-muted').hide();
}, 1000);
},
Then reload and check it.
Thank You!
Please check the video.
Thank You!
Thanx for support @NCP
But please while your code is active; test this report first and test a different report.
Thanks anyway bro. You are a real man!