即使在传递给它的值是false的情况下,我在dxForm中也有一个复选框,该复选框始终设置为true
我尝试使用formInstance.getEditor('active')。option('value',object.active);来获取数据后动态设置该值。但这似乎还是失败
$("#form").dxForm({
colCount: 2,
formData: object,
showValidationSummary: true,
labelLocation: "top",
items: [
{
dataField: "active",
editorType: "dxCheckBox"
},
{
itemType: "button",
buttonOptions: {
text: "Submit",
type: "success",
useSubmitBehavior: false,
onClick: this.SubmitClick
}
},
{
itemType: "button",
horizontalAlignment: "left",
buttonOptions: {
text: "Cancel",
type: "close",
useSubmitBehavior: false,
onClick: this.CancelClick
}
}
]
}).dxForm("instance");
var formInstance = $("#form").dxForm("instance");
然后我按如下所示设置表单值
let rowData = JSON.parse(e.target.getAttribute("data-action-type"));
lookupCategory.active = rowData.active
lookupCategory.isCreate = false
vueObj.CreateForm(lookupCategory);