【问题标题】:Visual Studio 2013 Lightswitch HTML Client - set data item to = table valueVisual Studio 2013 Lightswitch HTML 客户端 - 将数据项设置为 = 表值
【发布时间】:2014-11-21 00:55:25
【问题描述】:

我有这个场景,我有一个 Parts Table 和一个 Stock Table,Stock Table 包含一个字段 Quantity,现在当这个有一个值,我希望我的 DataItem 等于这个值,即 1。这样做的原因是对屏幕其他部分的验证,但这里的问题是如何在数据项中显示表格视图中的值。

它的数据绑定为Stocks(item).Quantity

使用此代码不起作用,但我知道我在正确的行:

element.innerText = contentItem.screen.Stocks(item).Quantity;

请任何人指出我遗漏了什么或我哪里出错了?谢谢

【问题讨论】:

    标签: visual-studio-lightswitch lightswitch-2013


    【解决方案1】:

    让它工作,在创建的屏幕上或在应用更改之前,if 语句中的这段代码解决了我的问题:

    if (screen.Stock.Quantity == null) {
        msls.showMessageBox("There is not enough in Stock, please enter a value equal to or less than the Stock Quantity", { title: "Aborted" }, { buttons: msls.MessageBoxButtons.ok }).then(function (result) {
            if (result == msls.MessageBoxResult.ok) {
            }
            screen.findContentItem("Stock_Quantity").value = 0;
        });
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多