DynamicForm.setDisabled(false)完全不起作用

时间:2015-10-21 20:20:17

标签: smartclient

首先让我说我是同构框架的新手,所以要温柔。

我禁用"表格"什么时候创建。然后,一旦用户点击"按钮"它应该启用它。我遇到的问题是它只启用TextItems,而不是Section标题或ButtonItems。我错过了什么?

表格

isc.DynamicForm.create({
    ID: "formSelectedUser",
    width: 540,
    numCols: 4,
    disabled: true,
    fields: [
        {
            defaultValue: "General Information", type: "section", sectionExpanded: true,
            itemIds: ["tbFirstName", "tbLastName", "tbEmailAddress", "tbUserName", "tbParentClient"]
        },
        { name: "tbFirstName", type: "text", title: "First Name" },
        { name: "tbLastName", type: "text", title: "Last Name" },
        { name: "tbEmailAddress", type: "text", title: "Email Address" },
        { name: "tbUserName", type: "text", title: "Username" },
        { name: "tbParentClient", type: "select", title: "Parent Client", defaultValue: "N/A" },
        {
            defaultValue: "Password Information", type: "section", sectionExpanded: true,
            itemIds: ["tbCurrentPassword", "tbNewPasswordAttemptOne", "tbNewPasswordAttemptTwo", "btnUpdatePassword"]
        },
        { name: "tbNewPasswordAttemptOne", type: "password", title: "New Password" },
        { name: "tbNewPasswordAttemptTwo", type: "password", title: "Confirm Password" },
        { name: "tbCurrentPassword", type: "password", title: "Current Password" },
        { type: "SpacerItem", colSpan: 1 },
        {
            name: "btnUpdatePassword", type: "ButtonItem", title: "Update Password", width: 146, endRow: false, startRow: false, click: function () {
                console.log("user wants to change password..");
            }
        }
    ]
});

按钮

isc.Button.create({
    name: "submit",
    type: "button",
    width: 140,
    title: "Submit",
    layoutAlign: "center",
    click: function () {
        formSelectedUser.setDisabled(false);
    }
});

1 个答案:

答案 0 :(得分:1)

好吧,这似乎是一个错误。实际上我从来没有在DynamicForm上使用setDisabled,通常我也使用setCanEdit,它也适用于section和buttons。它也适用于您的用例吗?