فهرست منبع

Merge branch 'fix/Selector.order_execption' into 'wrdp'

Merge of fix/Selector.order_execption to wrdp

See merge request o2oa/o2oa!2116
蔡祥熠 5 سال پیش
والد
کامیت
797449361d
1فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 5 3
      o2web/source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js

+ 5 - 3
o2web/source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js

@@ -143,8 +143,10 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit = new Class({
         if (this.options.dutyUnitLevelBy === "duty") {
             this.level1Container = [];
             if (this.options.units && this.options.units.length) {
-                var div = new Element("div").inject(this.itemAreaNode);
-                this.level1Container.push(div);
+                this.options.units.each( function (unit ,i) {
+                    var div = new Element("div").inject(this.itemAreaNode);
+                    this.level1Container.push(div);
+                }.bind(this))
             }
             this._loadSelectItemsByDutyUnit(unitTree);
         } else {
@@ -198,7 +200,7 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit = new Class({
                 var container = this.itemAreaNode;
                 if (this.level1Container && this.level1Container.length) {
                     var index = this.getIndexFromUnitOption(unit);
-                    if (index > -1 && (this.level1Container.length > index) && this.level1Container[i]) container = this.level1Container[i];
+                    if (index > -1 && (this.level1Container.length > index) && this.level1Container[index]) container = this.level1Container[index];
                 }
                 var category = this._newItemCategory("ItemCategory", unit, this, container);
                 this.subCategorys.push(category);