How to initialize a custom field?
How to initialize a custom field?
Vyacheslav
Posts: 70Questions: 27Answers: 0
in Editor
As we know Editor creates fields and shares them between calls ... but my custom field's view can be changed during inputting value (i.e. some independent check-boxes can be set or assigned classes etc.) ... I need a callback where I could reset a view of my custom field from previous usage .... or I've missed something?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
If I've understood correctly, I think you would just need to set up the event listeners in the
create
function for the field type - they would listen for whatever events will trigger the change and then perform that change.Allan
Unfortunately,
create
fires just once but I want to reset the field every time when Editor is open.Simply listen for the
open
event in that case. Add the listener in thecreate
function:Allan
Yep! That fits me well! Thank you again)