From 4d0c5a51c95b2ebba6b4512cd4c36b5a39f6d3c1 Mon Sep 17 00:00:00 2001 From: Martin Ender Date: Mon, 14 Dec 2015 16:35:54 +0100 Subject: [PATCH] Create custom-button.md --- .../custom-script-examples/custom-button.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/custom-button.md diff --git a/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/custom-button.md b/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/custom-button.md new file mode 100644 index 0000000000..81851cad16 --- /dev/null +++ b/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/custom-button.md @@ -0,0 +1,25 @@ +## 15.3.1.10 Eine benutzerdefinierte Schaltfläche hinzufügen + + frappe.ui.form.on("Event", "refresh", function(frm) { + frm.add_custom_button(__("Do Something"), function() { + // When this button is clicked, do this + + var subject = frm.doc.subject; + var event_type = frm.doc.event_type; + + // do something with these values, like an ajax request + // or call a server side frappe function using frappe.call + $.ajax({ + url: "http://example.com/just-do-it", + data: { + "subject": subject, + "event_type": event_type + } + + // read more about $.ajax syntax at http://api.jquery.com/jquery.ajax/ + + }); + }); + }); + +{next}