Skip to content

JS增强获取表单字段为undefined #1388

Closed
@anlem12

Description

@anlem12
版本号:

2.2 官方测试环境

问题描述:

JS增强获取表单字段为undefined

show(){
let formData = that.form.getFieldsValue()
console.log(formData)
}

截图&代码:

image

友情提示: 未按格式要求发帖,会直接删掉。

Activity

tygithub1

tygithub1 commented on Jun 29, 2020

@tygithub1

show(){
let formData = that.form.getFieldsValue()
console.log('show result>>',formData)
}

浏览器控制台打印:
show result>> {name: undefined, age: undefined, bpm_status: undefined, sex: undefined}

是的无论是编辑页面还是新增页面,都不能在show里面获取到表单的数据,因为这个时候表单数据还未加载

anlem12

anlem12 commented on Jun 30, 2020

@anlem12
Author

show(){
let formData = that.form.getFieldsValue()
console.log('show result>>',formData)
}

浏览器控制台打印:
show result>> {name: undefined, age: undefined, bpm_status: undefined, sex: undefined}

是的无论是编辑页面还是新增页面,都不能在show里面获取到表单的数据,因为这个时候表单数据还未加载

那有其他办法在窗体打开时获取到表单数据
或者在窗体加载后根据表单数据控制按钮

tygithub1

tygithub1 commented on Jul 10, 2020

@tygithub1

当前版本不支持,下个版本发布loaded事件

zhangdaiscott

zhangdaiscott commented on Jul 21, 2020

@zhangdaiscott
Member

当前版本已经支持,可以更新代码

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zhangdaiscott@tygithub1@anlem12

        Issue actions

          JS增强获取表单字段为undefined · Issue #1388 · jeecgboot/JeecgBoot