Created
April 12, 2018 19:54
-
-
Save MaxMorais/d31b04eafe9fb58bae667a5da5c1f0bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frappe.views.ReportView = frappe.views.ReportView.extend({ | |
setup_print: function(){ | |
this._super(); | |
var me = this; | |
this.page.add_menu_item(__("Print via Print Node"), function(){ | |
frappe.msgprint("Printing via Print Node"); | |
}, true); | |
} | |
}); | |
frappe.views.GridReport = frappe.views.GridReport.extend({ | |
setup_filters: function(){ | |
this._super(); | |
var me = this; | |
this.page.add_menu_item(__("Print via Print Node"), function(){ | |
frappe.msgprint("Printing via Print Node"); | |
}, true); | |
} | |
}); | |
frappe.views.QueryReport = frappe.views.QueryReport.extend({ | |
make_toolbar: function(){ | |
this._super(); | |
var me = this, | |
item_selector = 'li > a.grey-link', | |
$li = $('<li><a class="grey-link">' + __("Print via Print Node") + "</a></li>" ), | |
$link = $li.find('a').on('click', function(){ | |
frappe.msgprint("Printing via Print Node"); | |
}), | |
$sibling = this.page.menu.find('li > a.grey-link:contains("' + __("Print") + '")').parent(); | |
$li.insertAfter($sibling); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment