Adding dynamic fields with custom editor form not working
Adding dynamic fields with custom editor form not working
Hello
I have a custom editor form .. to which I add new input fields when user clicks a button on form.
But the newly added field is not showing in the form.. and when I try and add same field again i get error from datatable js,
so that means that the field is in fact getting added but its not showing on the editor form.
the custom form is like
<div id="customForm">
<fieldset class="firsthalf">
<legend>Dispatch</legend>
<div data-editor-template="id"></div>
</fieldset>
<fieldset class="secondhalf responsive-fieldset">
<legend>Sauda Details</legend>
</fieldset>
</div>
I am adding the field like
var field = {
'label' : "name",
'name' : "Hello.."
};
editor.add(field);
Please let me know whats the problem here... thanks in advance.
This question has an accepted answers - jump to answer
Answers
You'll need to modify your template to include the new field. You can get the template element using
template()
and then modify it using jQuery or DOM methods.Allan
Thanks allan..!!