pub trait JsActionHandler {
// Required methods
fn on_keystroke(
&mut self,
tree: &mut FieldTree,
field_id: FieldId,
change: &str,
js: &str,
) -> bool;
fn on_validate(
&mut self,
tree: &mut FieldTree,
field_id: FieldId,
js: &str,
) -> bool;
fn on_format(
&mut self,
tree: &FieldTree,
field_id: FieldId,
js: &str,
) -> Option<String>;
fn on_calculate(
&mut self,
tree: &mut FieldTree,
field_id: FieldId,
js: &str,
) -> Option<String>;
}Expand description
Callback interface for an external JavaScript engine.
Required Methods§
Sourcefn on_keystroke(
&mut self,
tree: &mut FieldTree,
field_id: FieldId,
change: &str,
js: &str,
) -> bool
fn on_keystroke( &mut self, tree: &mut FieldTree, field_id: FieldId, change: &str, js: &str, ) -> bool
Called on keystroke events (/K). Returns true if accepted.
Sourcefn on_validate(
&mut self,
tree: &mut FieldTree,
field_id: FieldId,
js: &str,
) -> bool
fn on_validate( &mut self, tree: &mut FieldTree, field_id: FieldId, js: &str, ) -> bool
Called on validate events (/V). Returns true if valid.