gpt4 book ai didi

javascript - Devexpress - 通过 Javascript/jQuery 设置编辑器的 "isValid"

转载 作者:行者123 更新时间:2023-12-01 01:39:40 25 4
gpt4 key购买 nike

我正在对 DevExpress 中的字段使用自定义验证,并且我需要在 Javascript 函数中设置字段是否有效。

我能够获取 isValid 属性:

$('#form').dxForm('instance').getEditor('appID').option('isValid')

但我不知道如何设置。

最佳答案

根据DevExtreme documentation about dxForm , option() 函数具有包含 2 个参数的重载:

option(optionName, optionValue)

Sets a value to the specified configuration option of this component.

Parameters:

  • optionName: String The name of the required option.

  • optionValue: any The value you wish to assign to the required option.

因此,您可以使用此行设置 isValid 验证选项:

$('#form').dxForm('instance').getEditor('appID').option('isValid', true);

相关用法:

dxForm - FormData update is triggering dxValidatiors on load

关于javascript - Devexpress - 通过 Javascript/jQuery 设置编辑器的 "isValid",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52531845/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com