Dynamically adding fields to editor for Bootstrap doesn't add form-control class to input

Dynamically adding fields to editor for Bootstrap doesn't add form-control class to input

ctam_guyctam_guy Posts: 7Questions: 1Answers: 0

Just as the name says when using the "editor.add()" function, with a bootstrap styled version of datatables, doesn't automatically add the "form-control" bootstrap styling class to the input element. Only closing and re-opening the editor form applies the bootstrap styling. Took a look inside the Bootstrap integration module, and just it looks like the styles only get applied on open

Editor Version 1.6.5

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    Thank you - I completely agree. The class is only added on the open event at the moment. I'll look into fixing this for the next release.

    Until then the workaround would be to do something like:

    editor.add( {
      name: 'newField',
      ...
    } );
    editor.field('newField').input().addClass( 'form-control' );
    

    Thanks for flagging this up.

    Allan

  • ctam_guyctam_guy Posts: 7Questions: 1Answers: 0

    Thanks for reading, and for the work around!

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    The fix for this has finally been committed and it will be included in the 1.7 release of Editor.

    Allan

This discussion has been closed.