nnnjjj123
2020-11-17 1b2c1edb61190eeb19f465ff031eaa3b2a1b8dbc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
///////////////////////////////////////////////////////////////////////////
// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////
 
define([
    'dojo/_base/lang',
    'dojo/_base/html',
    'dojo/Evented',
    'dojo/on',
    'dojo/dom-attr',
    'dojo/_base/declare',
    'dijit/_WidgetBase',
    'dojo/query',
    'dijit/form/ValidationTextBox',
    'dijit/form/NumberTextBox',
    'dijit/_TemplatedMixin',
    'dijit/_WidgetsInTemplateMixin',
    'dojo/text!./EditTable.html',
    'jimu/utils'
  ],
    function(lang, html, Evented, on, domAttr, declare, _WidgetBase, query,
      ValidationTextBox, NumberTextBox,
      _TemplatedMixin, _WidgetsInTemplateMixin,template, jimuUtils) {
 
    return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, Evented], {
        templateString: template,
        currentItem: null, //for radio
        dataList:[],
        codedValues: null,
 
        //optional
        isNumberField: true, //for validate
        tableType: 'unique', //for input[type=radio]
 
        postMixInProperties:function(){
          this.inherited(arguments);
          this.CommonNls = window.jimuNls.common;
          this.Nls = window.jimuNls.filterBuilder;
        },
 
        postCreate: function(){
          this.inherited(arguments);
          html.addClass(this.domNode, 'jimu-filter-mutcheck-list-value-provider');
 
          if(this.tableType === 'unique'){
            this.inputType = 'radio';
          }else{
            this.inputType = 'checkbox';
          }
        },
 
        //add dblclick event to item.
        _onListContentDblClicked: function(event){
          // console.log('dbclick...');
          this.isSearch = false;
          var target = event.target || event.srcElement;
          var itemDom = jimuUtils.getAncestorDom(target, function(dom){
            return html.hasClass(dom, 'item');
          }, 3);
          if(!itemDom){
            return;
          }
          if(!(html.hasClass(target, 'name') || html.hasClass(target, 'alias'))){
            return;
          }
 
          //allow to change emptyLabel
          if(html.hasClass(itemDom, 'empty') && html.hasClass(target, 'name') ){
            return;
          }
 
          if(this._dijit){//click another when one is active
            this.editState = 'active';
            this.updateInputDivPre = this.updateInputDiv;
            this._dijitPre = this._dijit;
          }else{
            this.editState = 'negative';
          }
 
          var nodeText = this._getNodeText(target);
          var nodeData = decodeURIComponent(html.getAttr(target, 'data'));
          //custom
          var isCustom = html.hasClass(itemDom, 'custom');
          this.placeHolder = (html.hasClass(target, 'name') && !this.codedValues) ? nodeData : nodeText;
          if(!isCustom){
            this.currentLabel = (this.isNumberField && html.hasClass(target, 'name') && !this.codedValues) ?
              parseFloat(this.placeHolder) : this.placeHolder;//string need to be number when operator is ','
          }else{
            if(html.hasClass(target, 'alias') && this.placeHolder !== this.customLabel){
              this.currentLabel = nodeText;
            }else{
              this.currentLabel = NaN;
            }
          }
 
          domAttr.set(target, "innerHTML", '');
 
          var searchHtml = '';
          if(html.hasClass(target, 'name')){
            // '<span class="searchBtn" data-dojo-attach-event="click:_onSearchClicked">Search</span>'
            // searchHtml = '<span class="searchBtn">' + this.CommonNls.search + '</span>';
            // searchHtml = '<div class="searchBtn jimu-icon jimu-icon-search"></div>';
            searchHtml = '<div class="searchBtn"><div class="jimu-icon jimu-icon-down-arrow-8"></div></div>';
          }
          this.updateInputDiv = html.create("div", {
            "class": "updateInputDiv",
            "innerHTML":  '<div class="inputDiv"></div>' + searchHtml
          }, target);
          var inputNode = query('.inputDiv', this.updateInputDiv)[0];
          this.searchBtn = query('.searchBtn', this.updateInputDiv)[0];
 
          this.own(on(this.updateInputDiv, 'dblclick', lang.hitch(this, function(event){
            // console.log('dbclick..input...');
            event.stopPropagation();
            event.preventDefault();
          })));
          var dijitOptions = {
            required: false,
            intermediateChanges: false,
            value: this.currentLabel
          };
          if(this.codedValues && html.hasClass(target, 'name')){
            dijitOptions.disabled = true;
          }
 
          if(this.isNumberField && html.hasClass(target, 'name')){ //number
            dijitOptions.constraints = {pattern: "#####0.##########"};
            this._dijit = new NumberTextBox(dijitOptions);
          }else{ //string
            dijitOptions.trim = true;
            this._dijit = new ValidationTextBox(dijitOptions);
          }
          this._dijit.startup();
 
          this._dijit.on('keydown', (function(e){
            var code = e.keyCode || e.which;
            if (code === 13) {
              this._dijit.emit('blur');
            }
          }).bind(this));
 
          // this._dijit.on('mouseleave', (function(event){
          this._dijit.on('blur', lang.hitch(this, function(){
            // input 1.235.265,256, then:
            //  _dijit._lastInputEventValue='1.235.265,256'
            //  _dijit.displayedValue = '1235265,256'
            //  _dijit.value = 1235265.256
            if(!this._dijit){
              return;
            }
            var newLabel = this._dijit.state !== 'Error'? this._dijit.displayedValue : this.currentLabel;
            if(this.isNumberField && html.hasClass(target, 'name') && this._dijit.state === 'Error'){
              this._dijit.setValue(parseFloat(newLabel));//reset last value when dijit has error.
            }
            newLabel = jimuUtils.sanitizeHTML(newLabel);
            var dijitVal = this._dijit.get('value');
            if(dijitVal === '' || !dijitVal){//back to its previous value('' || NaN)
              newLabel = this.placeHolder;
            }else{
              if(html.hasClass(target, 'name') && (this.placeHolder === this.customValue ||
                (this.placeHolder === 'NaN' && this._dijit.displayedValue !== ''))){//only verify by item's value
                var itemDom = jimuUtils.getAncestorDom(this._dijit.domNode, function(dom){
                  return html.hasClass(dom, 'item');
                }, 4);
                html.removeClass(itemDom, 'custom');
                this.emit("editTable_itemChanged");
              }
            }
 
            // domAttr.set(this._dijit.domNode.parentNode, "innerHTML", newLabel);
            // domAttr.set(this.updateInputDiv.parentNode, "innerHTML", newLabel);
            this.newLabel = newLabel;
 
            // setTimeout(lang.hitch(this, this._dijitBlurTimeout), 300);
            setTimeout(lang.hitch(this, function(){
              var newValue, displayTxt, labelTxt;
              if(!this.isSearch && this.editState !== 'active'){
                this.currentValLabel = this._dijit.displayedValue === '' ? this.customValue :
                  (this.isNumberField ? this._getLocalNumber(this._dijit.value) : this._dijit.value);
                var inputParentNode = this.updateInputDiv.parentNode;
                if(html.hasClass(inputParentNode, 'name') &&
                  (this.newLabel !== 'NaN' && this.newLabel !== this.customValue) &&
                  this._getNodeText(inputParentNode.nextSibling) === this.customLabel){//value triggers label only at first time.
                  labelTxt = this.isNumberField ? this.currentValLabel : this.newLabel;
                  html.setAttr(inputParentNode.nextSibling, 'data', encodeURIComponent(labelTxt));
                  this._setNodeText(inputParentNode.nextSibling, labelTxt);
                }
 
                newValue = html.hasClass(inputParentNode, 'name') ?
                  (this._dijit.displayedValue === '' ? this.customValue : this._dijit.value) : this.newLabel;
                html.setAttr(inputParentNode, 'data', encodeURIComponent(newValue));
                displayTxt = html.hasClass(inputParentNode, 'name') ? this.currentValLabel : this.newLabel;
                this._setNodeText(inputParentNode, displayTxt);
                this._dijit = null;
                this.isSearch = false;
              }else if(this.editState === 'active'){
                this.currentValLabel = this._dijitPre.displayedValue === '' ? this.customValue :
                (this.isNumberField ? this._getLocalNumber(this._dijitPre.value): this._dijitPre.value);
                var inputPreParentNode = this.updateInputDivPre.parentNode;
                if(html.hasClass(inputPreParentNode, 'name') &&
                  (this.newLabel !== 'NaN' && this.newLabel !== this.customValue) &&
                  (this._getNodeText(inputPreParentNode.nextSibling) === this.customLabel ||
                    this._dijit.value === this.customLabel)){
                  //don't trigger to update label if we click value, then click its label
                  if(html.isDescendant(this.updateInputDiv, inputPreParentNode.nextSibling) ){
                    // this._dijit.set('value', this._dijitPre.value);
                    this._dijit.set('value', this.currentValLabel);
                  }else{
                    labelTxt = this.isNumberField ? this.currentValLabel : this.newLabel;
                    html.setAttr(inputPreParentNode.nextSibling, 'data', encodeURIComponent(labelTxt));
                    this._setNodeText(inputPreParentNode.nextSibling, labelTxt);
                  }
                }
                newValue = html.hasClass(inputPreParentNode, 'name') ?
                (this._dijitPre.displayedValue === '' ? this.customValue : this._dijitPre.value) : this.newLabel;
                html.setAttr(inputPreParentNode, 'data', newValue);
                displayTxt = html.hasClass(inputPreParentNode, 'name') ? this.currentValLabel : this.newLabel;
                this._setNodeText(inputPreParentNode, displayTxt);
                this.updateInputDivPre = null;
                this._dijitPre = null;
                this.editState = 'negative';
              }
            }), 300);
            // this._dijit = null;
            this.placeHolder = '';
          }));
          html.setStyle(this._dijit.domNode, 'width', '100%');
          // this._dijit.placeAt(target);
          this._dijit.placeAt(inputNode);
 
          // this._dijit.onFocus();
          // this._dijit.domNode.focus();
          var input = query('input', this._dijit.domNode)[1];
          // if(this._dijit.get('value') === ''){
          //   domAttr.set(input, "placeholder", this.placeHolder);
          // }
          input.focus();
 
          if(this.searchBtn){
            this.own(on(this.searchBtn, 'click', lang.hitch(this, function(event){
              if(this.isSearch){//prevent secondary clicks
                // console.log('repeated click');
                return;
              }
              this.isSearch = true;
              var _target = event.target || event.srcElement;
              this.searchTarget = _target;
              this.emit("editTable_openListSelectByName", this.newLabel);
              event.stopPropagation();
              event.preventDefault();
            })));
 
            if(this.codedValues){
              this.searchBtn.click();
            }
          }
        },
 
        _getLocalNumber: function(num){
          if(typeof num === 'string'){
            num = parseFloat(num);
          }
          this.emit('editTable_getValLabelsArrayForNumber', true, [num]);
          return this.currentValLabel;
        },
 
        _setNewLabel: function(value, name){
          if(value === undefined && name === undefined){
            if(this._dijit.displayedValue !== ''){
              if(this.codedValues){
                name = this._dijit.displayedValue;
                value = this._getCodeFromCodevalueLabel(name);
              }else{
                value = this._dijit.value;
                name = value;
                if(this.isNumberField && this.newLabel !== this.customValue){
                  name = this._getLocalNumber(value);
                }
              }
            }else{
              value = name = this.customValue;
            }
          }
          // this._dijit.set('value', name);
          // name = name ? name : this.newLabel;
          if(this.updateInputDiv && this.updateInputDiv.parentNode){
            var nameNode = this.updateInputDiv.parentNode;
            if(name !== this.customValue && this._getNodeText(nameNode.nextSibling) === this.customLabel){
              html.setAttr(nameNode.nextSibling, 'data', encodeURIComponent(name));
              this._setNodeText(nameNode.nextSibling, name);
            }
            if(!this.codedValues){
              value = value ? value : decodeURIComponent(html.getAttr(nameNode, 'data'));
            }
            html.setAttr(nameNode, 'data', encodeURIComponent(value));
            var itemDom = nameNode.parentNode;
            if(name !== this.customValue){
              html.removeClass(itemDom, 'custom');
            }
            this._setNodeText(nameNode, name);
          }
          this.updateInputDiv = null;
          this._dijit = null;
        },
 
        // _onSearchClicked: function(){
        //   this.emit("editTable_openListSelectByName", 'table');
        // },
 
        _onListContentClicked: function(event){
          var target = event.target || event.srcElement;
          var itemDom = jimuUtils.getAncestorDom(target, function(dom){
            return html.hasClass(dom, 'item');
          }, 3);
          if(!itemDom){
            return;
          }
          if(html.hasClass(target, 'checkboxEmpty')){
            if(html.hasClass(target, 'checked')){
              html.removeClass(target, 'checked');
            }else{
              html.addClass(target, 'checked');
            }
          }else if(html.hasClass(target, this.inputType)){
            if(this.inputType === 'radio' && this.currentItem === true){
              this.currentItem = this.getCurrentItem();
            }
            if(html.hasClass(target, 'checked')){
              if(this.inputType !== 'radio'){
                html.removeClass(target, 'checked');
              }else if(!html.hasClass(this.currentItem, 'checked')){ //can't unchecked current radio
                html.removeClass(target, 'checked');
              }
            }else{
              if(this.inputType === 'radio' && this.currentItem){
                html.removeClass(this.currentItem, 'checked');
              }
              html.addClass(target, 'checked');
              this.currentItem = target;
            }
          }else if(html.hasClass(target, 'action')){
            // if(html.hasClass(target, 'enabled')){
            //   html.removeClass(target, 'enabled');
            //   html.addClass(target, 'disabled');
            // }else if(html.hasClass(target, 'disabled')){
            //   html.removeClass(target, 'disabled');
            //   html.addClass(target, 'enabled');
            // }else
            if(html.hasClass(target, 'up')){
              if(itemDom.previousElementSibling){
                html.place(itemDom, itemDom.previousElementSibling, 'before');
              }
            }else if(html.hasClass(target, 'down')){
              if(itemDom.nextElementSibling){
                html.place(itemDom, itemDom.nextElementSibling, 'after');
              }
            }else if(html.hasClass(target, 'delete')){
              html.destroy(itemDom);
              this.emit('editTable_itemChanged');
            }
          }
        },
 
        _getLabelFromCodevalue: function(codevalue){
          var label = codevalue;
          for(var key = 0; key < this.codedValues.length; key ++){
            var item = this.codedValues[key];
            if(item.value === codevalue){
              label = item.label;
              break;
            }
          }
          return label;
        },
 
        _getCodeFromCodevalueLabel: function(label){
          var codevalue = label;
          for(var key = 0; key < this.codedValues.length; key ++){
            var item = this.codedValues[key];
            if(item.label === label){
              codevalue = item.value;
              break;
            }
          }
          return codevalue;
        },
 
        _createEmptyTarget: function(dataList){
          var name = this.emptyStr;
          var label = this.emptyLabel ? this.emptyLabel : name;
          var checkedClass = ' checked';
          for(var key = 0; key < dataList.length; key ++){
            if(dataList[key].isChecked){
              checkedClass = '';
              break;
            }
          }
          if(checkedClass === ' checked'){
            this.currentItem = true;
          }
          var dataAttr = "data=\"" + encodeURIComponent(name) + "\"";
 
          var enableClass = '';
          var enableTitle = this.Nls.emptyValueTips;
          if(dataList.length === 0 || this.enableEmpty){
            enableClass = ' checked';
          }
 
          var target = html.create("div", {
            "class": 'item empty',
            "innerHTML": '<div class="label name jimu-ellipsis" style="cursor: default;"' + dataAttr + '>' +
                         name + '</div>' +
                         '<div class="label alias jimu-ellipsis-Blanks" data="' + label + '">' + label + '</div>' +
                         '<div class="label ' + this.inputType + checkedClass + ' jimu-ellipsis"></div>' +
                         '<div class="label checkbox checkboxEmpty' + enableClass + ' jimu-ellipsis jimu-flipx" ' +
                         'title="' + enableTitle + '"></div>'
          }, this.listContent);
          return target;
        },
 
        _createTarget: function(name, nameLabel, label, checkedClass, isCustom){
          var itemClass = 'item';
          if(isCustom){
            name = nameLabel = this.customValue;
            label = this.customLabel;
            itemClass = 'item custom';
          }
          name = (name || name === 0) ? name : ""; //name could be 0 when it's a numberical field.
          nameLabel = nameLabel || "";
          label = label ? label : name;
          checkedClass = checkedClass ? checkedClass : '';
          //save value to nameDom include codedvalue
          var value = name, dataAttr = '';
          if((this.codedValues || this.isNumberField) && name !== this.Nls.addValuePlaceHolder){
            value = this.codedValues ? this._getLabelFromCodevalue(name) : nameLabel;
          }
          var dataValue = this.isNumberField ? name : encodeURIComponent(name);//string maybe has ',""
          dataAttr = "data=\"" + dataValue + "\"";
          var target = html.create("div", {
            "class": itemClass,
            "innerHTML": '<div class="label name jimu-ellipsis-Blanks" ' + dataAttr + '>' +
                         value + '</div>' +
                         '<div class="label alias jimu-ellipsis-Blanks" data="' + label + '">' + label + '</div>' +
                         '<div class="label ' + this.inputType + checkedClass + ' jimu-ellipsis"></div>' +
                         '<div class="actions jimu-float-trailing">' +
                            '<div class="delete action jimu-float-trailing"></div>' +
                            '<div class="down action jimu-float-trailing"></div>' +
                            '<div class="up action jimu-float-trailing"></div>' +
                         '</div>'
          }, this.listContent);
          return target;
        },
 
        _destroyTarget: function(name){
          var labels = query('.item .name', this.listContent);
          for(var key = 0; key < labels.length; key++){
            var label = labels[key];
            var labelTxt = domAttr.get(this._dijit.domNode.parentNode, "innerHTML");
            if(labelTxt === name){
              html.destroy(label.parentNode);
              break;
            }
          }
        },
 
        getCurrentItem: function(){
          var items = query('.item .radio', this.listContent);
          for(var key = 0; key < items.length; key ++){
            var item = items[key];
            if(html.hasClass(item,'checked')){
              return item;
            }
          }
          return null;
        },
 
        _getEmptyLabel: function(){
          var labelDom = query('.label.alias', this.listContent.firstChild)[0];
          var label = this._getNodeText(labelDom);
          if(labelDom.children.length){//edit state
            label = this._dijit.state === 'Error' ?
              decodeURIComponent(html.getAttr(labelDom, 'data')) : this._dijit.value;
          }
          label = jimuUtils.sanitizeHTML(label);
          return label;
        },
 
        _getEmptyStatus: function(){
          // return query('.enabled', this.listContent.firstChild).length;
          var emptyDom = query('.checkboxEmpty', this.listContent.firstChild)[0];
          return html.hasClass(emptyDom, 'checked') ? true : false;
        },
 
        _getNodeText: function(target){
          return target.textContent || target.innerText || '';
        },
 
        _setNodeText: function(target, label){
          target.innerHTML = '&nbsp;'; //for inputDom tree
          if(target.textContent){
            target.textContent = label;
          }else{
            target.innerText = label;
          }
        },
 
        getListValues: function(){
          this.listItemsArray = [];//['a','b','c'];
          this.listValuesArray = [];
          var items = query('.item .name',this.listContent);
          var firstKey = this.inputType === 'radio' ? 1 : 0;
          for(var key = firstKey; key < items.length; key ++){
            var item = items[key];
            var parentDom = jimuUtils.getAncestorDom(item, function(dom){
              return html.hasClass(dom, 'item');
            }, 3);
            if(html.hasClass(parentDom, 'custom')){//delete item if value does not update
              continue;
            }
            var itemVal = this._getNodeText(item);
            var itemData = decodeURIComponent(html.getAttr(item, 'data'));
            if(this.isNumberField || this.codedValues){
              itemVal = itemData;
            }
            if(item.children.length){//edit state
              itemVal = this._dijit.state === 'Error' ? itemData : this._dijit.value;
              if(this.codedValues){
                var code = this._getCodeFromCodevalueLabel(itemVal);
                itemVal = code !== undefined ? code : itemData;
              }
            }
            itemVal = this.isNumberField? parseFloat(itemVal): jimuUtils.sanitizeHTML(itemVal);
 
            var alias = this._getNodeText(item.nextSibling);
            if(alias === this.customLabel){//when value exists and label is undefined yet
              alias = itemVal.toString();
              if(this.isNumberField){
                alias = this._getLocalNumber(alias);
              }
            }
            if(item.nextSibling.children.length){//edit state
              alias = this._dijit.state === 'Error' ?
                decodeURIComponent(html.getAttr(item.nextSibling, 'data')) : this._dijit.value;
            }
            alias = jimuUtils.sanitizeHTML(alias);
            var itemObj = {
              value: itemVal,
              alias: alias,
              isChecked: false
            };
            this.listItemsArray.push(itemObj);
            this.listValuesArray.push(itemVal);
            if(html.hasClass(item.nextSibling.nextSibling, 'checked')){
              itemObj.isChecked = true;
            }
          }
          var result = {
            list: this.listItemsArray,
            valueList: this.listValuesArray //for multiple select to verify if cbxItem should be checked
          };
          if(this.inputType === 'radio'){
            result.emptyLabel = this._getEmptyLabel();
            result.enableEmpty = this._getEmptyStatus();//save this to config to keep old version
          }
          return result;
        },
 
        setListValues: function(dataList, labelsArray){
          domAttr.set(this.listContent, "innerHTML", '');
          if(this.inputType === 'radio'){ // only radio has empty target
            this._createEmptyTarget(dataList);
          }
          for(var key = 0; key < dataList.length; key ++){
            var data = dataList[key];
            var checkedClass = '';
            if(data.isChecked){
              checkedClass = ' checked';
              this.currentItem = true;
            }
 
            var valLabel = labelsArray ? labelsArray[key].label : data.value;
            this._createTarget(data.value, valLabel, data.alias, checkedClass);
          }
        },
 
 
        _initTable: function(){
 
        },
 
        getDijits: function(){
          return [this.mutiValuesSelect];
        },
 
        destroy:function(){
          this.inherited(arguments);
        }
      });
  });