/* eslint-disable */
Ext.ns('Ext.ux.form');

Ext.ux.form.XSet = Ext.extend(Ext.form.CheckboxGroup, {
  xtype: 'xset',
  columns: 1,
  items: [],

  initComponent: function() {
    var items = [];
    var scope = this.ct;
    Ext.each(this.options, function(item) {
      items.push({
        allowBlank: true,
        boxLabel: item.replace(/_/g, ' '),
        submitValue: false,
        name: item,
        checked: true,
        renderTo: scope,
        labelSeparator: ''

      });
    });
    this.items = items;
    Ext.ux.form.XSet.superclass.initComponent.call(this);
  },

  isDirty: function(){
    if(typeof this.originalValue !== 'undefined') {
      return this.getValue() !== this.originalValue;
    }
    return false;
	},

  setValue: function(value) {
    var val = {};
    Ext.each(this.items.items, function(i){
      if (i) {
        val[i.name] = false;
      }
    });

    if (value) {
      Ext.each(Array.isArray(value) ? value : value.split(','), function(v){
        val[v] = true;
      });
    }
    Ext.ux.form.XSet.superclass.setValue.call(this, val);
  },

  getValue: function(value) {
    var val = [];
    Ext.each(this.items.items, function(i){
      if (i.checked) {
        val.push(i.name);
      }
    });
    return val.join(',');
  },
});

Ext.reg('xset', Ext.ux.form.XSet);

@@ -218,28 +218,31 @@
 ct;%0A    Ext.
-each
+iterate
 (this.option
@@ -253,20 +253,26 @@
 unction(
-item
+key, value
 ) %7B%0A    
@@ -330,20 +330,49 @@
 xLabel: 
-item
+typeof value === 'string' ? value
 .replace
@@ -382,16 +382,22 @@
 /g, ' ')
+ : key
 ,%0A      
@@ -432,20 +432,19 @@
   name: 
-item
+key
 ,%0A      
@@ -775,9 +775,10 @@
 se;%0A
-%09
+  
 %7D,%0A%0A

Fix enum fields with string as key