diff --git a/app/AppStart/UISample.js b/app/AppStart/UISample.js
index 96e0ec6..209c931 100644
--- a/app/AppStart/UISample.js
+++ b/app/AppStart/UISample.js
@@ -2,7 +2,7 @@
*
* @author jskonst
*/
-define('UISample', ['orm', 'forms', 'ui','FancyWidget', '../CustomWidgets/Button'], function (Orm, Forms, Ui,FancyWidget, Button, ModuleName) {
+define('UISample', ['orm', 'forms', 'ui','FancyWidget', '../CustomWidgets/Button', '../CustomWidgets/Dropdown'], function (Orm, Forms, Ui,FancyWidget, Button, Dropdown, ModuleName) {
function module_constructor() {
var self = this
, model = Orm.loadModel(ModuleName)
@@ -18,11 +18,18 @@ define('UISample', ['orm', 'forms', 'ui','FancyWidget', '../CustomWidgets/Button
var btn = new Button(form.pnlPlaceholder3);
btn.height=30;
- btn.width=60;
+ btn.width=160;
+ btn.text = "Another text";
btn.onActionPerformed = function(){
console.log("hello world");
}
+ //dropdown
+ var dropdown = new Dropdown(form.pnlPlaceholder4);
+ dropdown.height=30;
+ dropdown.width=350;
+ dropdown.text="Hello";
+// btn.text = "Another text";
diff --git a/app/AppStart/UISample.layout b/app/AppStart/UISample.layout
index 2f2e60e..d526bff 100644
--- a/app/AppStart/UISample.layout
+++ b/app/AppStart/UISample.layout
@@ -1,9 +1,12 @@
-
+
+
+
+
diff --git a/app/CustomWidgets/Button.js b/app/CustomWidgets/Button.js
index 783efcf..146388f 100644
--- a/app/CustomWidgets/Button.js
+++ b/app/CustomWidgets/Button.js
@@ -9,7 +9,8 @@ define(['forms/box-pane'],function (BoxPane) {
function GreatButton(placeholder) {
var self = this;
- //Button or any other widget could be created by own hands here
+ //Button or any other widget could be created by own hands here
+ //div
var greatBtn = new BoxPane();
greatBtn.element.className+="btn btn-primary";
@@ -18,6 +19,9 @@ define(['forms/box-pane'],function (BoxPane) {
var pnlPlaceholder = placeholder;
pnlPlaceholder.add(greatBtn);
+ //Text
+ //greatBtn.element.innerHTML = 'Some text';
+
//Sizes
Object.defineProperty(this,'height', {
set:function(val){greatBtn.height=val;}
@@ -32,6 +36,10 @@ define(['forms/box-pane'],function (BoxPane) {
set:function(aAction){ greatBtn.element.addEventListener("click",aAction);}
});
+ Object.defineProperty(this,'text', {
+ set:function(val){greatBtn.element.innerHTML = val;}
+ });
+
}
return GreatButton;
diff --git a/app/CustomWidgets/Dropdown.js b/app/CustomWidgets/Dropdown.js
new file mode 100644
index 0000000..75f00a8
--- /dev/null
+++ b/app/CustomWidgets/Dropdown.js
@@ -0,0 +1,82 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+
+define(['forms/box-pane'],function (BoxPane) {
+ function Dropdown(placeholder) {
+ var self = this;
+
+ //Button or any other widget could be created by own hands here
+ //div dropdown
+ var dropdown = new BoxPane();
+ dropdown.element.className+="dropdown";
+
+
+ //Button
+ var dBtn = new BoxPane();
+ dBtn.element.className+="btn btn-default dropdown-toggle";
+ dBtn.element.type+="button";
+ dBtn.element.id+="dropdownMenu1";
+ dBtn.element.setAttribute("data-toggle", "dropdown");
+ dBtn.element.setAttribute("aria-haspopup","true");
+ dBtn.element.setAttribute("aria-expanded", "true");
+ dropdown.add(dBtn);
+
+
+ // List
+ var list = new BoxPane();
+ list.element.innerHTML = '
\
+ \
+ \
+
';
+ dropdown.add(list);
+// var UlDropdown = document.createElement('ul');
+// UlDropdown.element.className+="dropdown-menu";
+// UlDropdown.element.setAttribute("aria-labelledby", "dropdownMenu1");
+// dropdown.add(UlDropdown);
+//
+// var LiDropdown = document.createElement('li');
+// UlDropdown.add(LiDropdown);
+//
+// var LinkDropdown = document.createElement('a');
+// LiDropdown.add(LinkDropdown);
+
+ //and
+ var pnlPlaceholder = placeholder;
+ pnlPlaceholder.add(dropdown);
+
+ //Text
+ //greatBtn.element.innerHTML = 'Some text';
+
+ //Sizes
+
+ Object.defineProperty(this,'width', {
+ set:function(val){pnlPlaceholder.width=val;}
+ });
+
+ Object.defineProperty(this,'height', {
+ set:function(val){dropdown.height=val;}
+ });
+
+ Object.defineProperty(this,'text', {
+ set:function(val){dBtn.element.innerHTML = val + " "+ "";}
+ });
+
+
+
+
+ }
+ return Dropdown;
+});
\ No newline at end of file
diff --git a/application-start.html b/application-start.html
index b90dff6..cc2690f 100644
--- a/application-start.html
+++ b/application-start.html
@@ -7,8 +7,16 @@
+
+
+
-
+
+
+
+
+
+