Manipulating Editor form
Manipulating Editor form
Hi, Allan -
Wondering if there's a means by which the form that Editor renders can be interacted with? I'd like to add a few elements underneath the generated inputs and labels. Specifically, I'd like to display another DataTables instance with detail rows for the header record being created or edited. I thought it'd be as easy as $('#DTE_Form_Content').append('yada yada yada') within the editor.on('open', ...) event, but it doesn't appear that DTE_Form_Content has been added when the open event fires.
Any shove in the right direction would be much appreciated...congrats on your new addition & thanks very much for creating such awesome software...DataTables is awesome of course, but I'm just beginning to appreciate how Editor is going to save me a lot of time!
Sean
Answers
Think I've got a handle on this, turns out DTE_Form_Content is a class, not an ID...yeah that's what happens when I miss my afternoon coffee.
Still interested in whether or not there's a more direct/intentional way of accomplishing the extended form, but I'm able to make changes to it this way. Thanks.
Hi,
Thanks for your kind words :-). I hope you get a lot of great use from the software.
Regarding your question - listen for the
displayOrder
which Editor will emit whenever the form is re-rendered. It is in that event handler that you should insert whatever additional content you need into the DOM.At the moment using DOM selectors (as you were) is the best way to do it - the DOM structure used by Editor is documented here. I think the key is to use the
displayOrder
event which was added specifically for this sort of thing!Allan