機械翻訳について

CustomEditorオブジェクト

field.createCustomEditor()は、CustomEditorオブジェクトを返します。 フィールド・オブジェクトにはフィールド・データが保持されます。

メソッド パラメータ 必須 戻り値 使用方法
getFrame()

なし

該当なし

カスタム・フィールド・エディタのURLに設定されたsrcを含むiframe要素。

var customEditor = field.createCustomEditor(customFieldEditor);
//get custom editor's frame
var editorFrame = customEditor.getFrame();
setDisabled(disable)

ノート: この関数は、カスタム・エディタの準備完了後に起動する必要があります。

ture | false

はい

カスタム・フィールド・エディタにカスタム・フィールド・エディタが存在する場合は、registerDisable()関数で登録されたカスタム・フィールド・エディタの無効化コールバック関数を起動します。
customEditor.on('editorReady', function () {
  //to disable the custom field editor
  customEditor.setDisabled(true);
});
getValue()

なし

該当なし

カスタム・フィールド・エディタで値を返します。

customEditor.getValue();
validate()

なし

該当なし

カスタム・フィールド・エディタにカスタム・フィールド・エディタが存在する場合は、setValidation()関数で登録されたカスタム・フィールド・エディタの検証コールバック関数を起動します。 約束を返します。 適合している場合は、検証オブジェクトを返します。

// when valid
{
  isValid: true,
}
  
// when invalid
{
  isValid: false,
  errorMessageSummary: <error message>
  errorMessageDetail: <detail error message>
};
customEditor.validate().then(function (validation) {
  if (validation && validation.isValid) {
    // handle valid field value
  } else {
    //display validation error
  }
}).catch(function (error) {
  // handle error
});
resizeEditorFrame(size)

高さと幅を持つオブジェクト

はい

カスタム・エディタを含むフレームを指定したサイズに変更します。

customEditor.resizeEditorFrame({
    width: '600px',
    height: '250px'
});
on(event, handler)

event - 文字列

handler - イベントを処理する関数

はい

サポートされているイベント。
  • editorReady
  • change
  • editorResized
customEditor.on('editorReady', function () {
  // if the editor needs any disabling, it can happen here
});
 
 
customEditor.on('editorResized', function (data) {
 // if any dom elements needs to be adjusted
});
 
// look for change even to grab the editor's changed value
customEditor.on('change', function (value) {
  // validate field value if necessary
  field.validate(value).then(function (validation) {
    if (validation && validation.isValid) {
      // handle valid field value
    } else {
      //display field validation error
    }
  }).catch(function (error) {
    // handle error
  });
});