aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/src/app/ui/checkField/checkField.js
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/src/app/ui/checkField/checkField.js')
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/src/app/ui/checkField/checkField.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/src/app/ui/checkField/checkField.js b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/src/app/ui/checkField/checkField.js
new file mode 100644
index 000000000..d5f50127e
--- /dev/null
+++ b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/plugins/head/src/app/ui/checkField/checkField.js
@@ -0,0 +1,25 @@
+(function( app ) {
+
+ var ui = app.ns("ui");
+
+ ui.CheckField = ui.AbstractField.extend({
+ _main_template: function() { return (
+ { tag: "DIV", id: this.id(), cls: "uiCheckField", children: [
+ { tag: "INPUT", type: "checkbox", name: this.config.name, checked: !!this.config.value }
+ ] }
+ ); },
+ validate: function() {
+ return this.val() || ( ! this.require );
+ },
+ val: function( val ) {
+ if( val === undefined ) {
+ return !!this.field.attr( "checked" );
+ } else {
+ this.field.attr( "checked", !!val );
+ }
+ }
+ });
+
+})( this.app );
+
+