Skip to content

表单解析API

在表单解析开发过程中提供的属性及方法

属性

  • 表单ID - string

      var id = horizon.form.id
    
  • 业务数据ID - string

      var dataId = horizon.form.dataId
    

可调用的方法

  • 保存表单 - function

      horizon.form.submit(event)
    
  • 打印表单 - function

      horizon.form.print(event)
    

可实现的方法

  • 表单提交前事件 - function

      horizon.impl_beforeSubmit = function() {
          alert('beforeSubmit');
          return true;
      }
    

    需要返回boolean值,如果返回为false时,则不会提交表单。

  • 表单提交后事件 - function

      horizon.impl_afterSubmitSuccess = function(data) {
          alert('afterSubmitSuccess');
      }
    

    参数说明:

    • data: object
      • id: string- 表单ID
      • dataId: string- 业务数据ID
      • result: boolean - 是否保存成功

提示

若实现了该方法,将不会出现「保存成功!是否继续编辑?」的提示框。

  • 表单加载后事件 - function

      horizon.impl_load = function() {
          alert('load');
      }