diff --git a/src/Alloy.Mvc.Template/ClientResources/Scripts/Components/CustomComponent.js b/src/Alloy.Mvc.Template/ClientResources/Scripts/Components/CustomComponent.js
index 40d32db..4a1b983 100644
--- a/src/Alloy.Mvc.Template/ClientResources/Scripts/Components/CustomComponent.js
+++ b/src/Alloy.Mvc.Template/ClientResources/Scripts/Components/CustomComponent.js
@@ -1,20 +1,28 @@
define([
// Dojo
"dojo/_base/declare",
+ "dojo/on",
"dojo/html",
// Dijit
"dijit/_TemplatedMixin",
"dijit/_WidgetBase",
+ "dijit/form/TextBox",
//CMS
+ "epi/shell/widget/dialog/Dialog",
+ "epi/shell/DialogService",
"epi-cms/_ContentContextMixin"
], function (
// Dojo
declare,
+ on,
html,
// Dijit
_TemplatedMixin,
_WidgetBase,
+ TextBox,
//CMS
+ Dialog,
+ dialogService,
_ContentContextMixin
) {
return declare([_WidgetBase, _TemplatedMixin, _ContentContextMixin], {
@@ -23,6 +31,10 @@ define([
templateString: '
\
\
+
\
+
\
+
\
+
\
',
postMixInProperties: function () {
@@ -31,6 +43,60 @@ define([
}.bind(this));
},
+ postCreate: function () {
+ this.own(on(this.alertNode, "click", function () {
+ dialogService.alert({
+ title: "alert title",
+ heading: "heading",
+ content: "content",
+ description: "description",
+ iconClass: "epi-iconDownload"
+ });
+ }));
+
+ this.own(on(this.confirmationNode, "click", function () {
+ dialogService.confirmation({
+ title: "confirmation title",
+ heading: "heading",
+ content: "content",
+ description: "description",
+ iconClass: "epi-iconDownload"
+ }).then(function () {
+ alert("clicked OK");
+ }).otherwise(function () {
+ alert("clicked cancel");
+ });
+ }));
+
+ this.own(on(this.dialogServiceNode, "click", function () {
+ dialogService.dialog({
+ title: "dialog title",
+ heading: "heading",
+ content: new TextBox({label: "Text 1", _type: "field"}),
+ description: "description",
+ iconClass: "epi-iconDownload"
+ }).then(function () {
+ alert("clicked OK");
+ }).otherwise(function () {
+ alert("clicked cancel");
+ });
+ }));
+
+ this.own(on(this.dialogNode, "click", function () {
+ var dialog = new Dialog({
+ heading: "heading",
+ content: new TextBox({label: "Text 1", _type: "field"}),
+ description: "description",
+ iconClass: "epi-iconDownload"
+ });
+ dialog.on("execute", function () {
+ // run custom needed logic
+ dialog.hide();
+ });
+ dialog.show();
+ }));
+ },
+
contextChanged: function (context, callerData) {
this.inherited(arguments);