Dynamic add fields in initEdit function

Dynamic add fields in initEdit function

yy113420113yy113420113 Posts: 2Questions: 1Answers: 0
edited September 2016 in Free community support

I want add some field dynamically after editor window shown, and I try following code.

editor.on( 'initEdit', function(e, node, data) {
    this.add(
        {label: 'test', name: 'test'}, 
        'domain'
    ).set('test', 'just for test');
});

I got errors TypeError: s[f] is undefined when submit the form.
I need help.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,831Questions: 1Answers: 10,518 Site admin
    Answer ✓

    Hi,

    Unfortunately, that looks like a bug in Editor. Thanks for letting me know about it. I'm afraid there is no simple workaround at the moment - although I will look for one.

    Allan

  • yy113420113yy113420113 Posts: 2Questions: 1Answers: 0

    Is there any other way to solve this problem?

  • allanallan Posts: 63,831Questions: 1Answers: 10,518 Site admin

    No - as I say, I don't think there is a workaround for this. The issue is that the internal data structure isn't correctly handling this situation. I hope to get a chance to look into it in more detail today.

    Allan

  • allanallan Posts: 63,831Questions: 1Answers: 10,518 Site admin

    Sorry for the long delay with this one. I've just committed a fix for this problem and it will be available in Editor 1.6 which will drop next week.

    Regards,
    Allan

This discussion has been closed.