Editor Event
Editor Event
Link to test case: https://live.datatables.net/kumiwisi/10/edit
Description of problem: Hello all. I am trying to do something that seems simple but just doesn't seem to work. I have an editor instance with a custom form layout. In this layout is some static text and elements (legend, HR) that I want to start out hidden. I am using bootstrap and adding a class of d-none. This works well, except I cannot figure out how to remove the class once the editor form is open. I tried using the initEditor event remove the class once editor has fully been instantiated. Anyway, I cant get the event to fire. See above link. Shouldn't the example above print in the console when the form is displayed? I have tried using initEdit and it fires, but does not seem to allow me to remove or add a class to a static element. Thoughts?
This question has an accepted answers - jump to answer
Answers
Your example crashes when trying to edit a record.
It doesn't work either when you try to create a new record. Nothing is written to the console.
But if you replace:
with
"Form displayed" is being written to the console - in case you are creating a new record.
Thanks for the answer. Not sure why InitEditor isn't firing. But 'opened' works like a charm.
I know in my example the edit doesn't work, and there is nothing running to make the new work, I was just using it as example of the form and the event.
"InitEditor" is supposed to be something extraordinary. Before you posted this I wasn't even aware that it existed
Glad you got this resolved!!
The event is
initEdit
notinitEditor
.Kevin
Hey Kevin! How are you? That was exactly my thinking! And then I found this:
https://editor.datatables.net/reference/event/initEditor
lol
Roland
I see :-).
Kevin