代码之家  ›  专栏  ›  技术社区  ›  Srikanth Konanki

在Resco Mobile CRM中隐藏选项

  •  1
  • Srikanth Konanki  · 技术社区  · 7 年前

    我想隐藏Field Service-Dynamics 365应用程序上的Optionset值。我们正在使用伍德福德解决方案进行定制。基于Resco Javascript桥参考,我看不到在现有选项集中隐藏选项的方法。所以我创建了一个组合框,并尝试将选项添加到组合框中。但它只显示一个选项,即使我在组合框上添加了多个标签错误的选项。

    if ((responseTypeOptionSetValues.length == responseTypeOptionSetLables.length)
          && responseTypeOptionSetLables.length > 0) {
        for (i = 0; i < responseTypeOptionSetValues.length; i++) {
            if (valueListOptions.length > 0) {
                for (i = 0; i < responseTypeOptionSetValues.length; i++) {
                    if (valueListOptions.indexOf(responseTypeOptionSetValues[i].toString()) != -1) {
                        finalLabelValue = responseTypeOptionSetLables[i].toString();
                        finalOptionValue = responseTypeOptionSetValues[i].toString();
                        comboItem.listDataSource = {
                            **finalLabelValue: finalOptionValue,**
                                    };
                    }
                }
            }
        }                
    }
    
    2 回复  |  直到 7 年前
        1
  •  1
  •   mrsrinivas    7 年前
    var data = new Object();
    
    if ((responseTypeOptionSetValues.length == responseTypeOptionSetLables.length) && responseTypeOptionSetLables.length > 0) {
        for (i = 0; i < responseTypeOptionSetValues.length; i++) {
            if (valueListOptions.indexOf(responseTypeOptionSetValues[i].toString()) != -1) {
                finalLabelValue = responseTypeOptionSetLables[i].toString();
                finalOptionValue = responseTypeOptionSetValues[i].toString();                      
                data[finalLabelValue] = finalOptionValue;
            }
        }
    }
    if (!isComboItemExists) {
        comboItem.listDataSource = data;
        detailView.insertItem(comboItem, -1);
    }
    else {
        comboItem.listDataSource = data;
    }
    
        2
  •  0
  •   Daryl    7 年前

    您使用相同的变量名嵌套循环。给每个循环一个唯一的变量:i,j,k。。。