Multiple TinyMce not showing/Init right

805 Views Asked by At

Iam using TinyMce with the ui-tinymce Package.
First I had multiple TinyMce generated through ng-repeat in a Table which worked fine. For Comparison now the ng-repeat generates a second TinyMce which is readonly without Functionality.
Since this sometimes on random behavior some TinyMce Editors are not generated in the Second <td>..</td>?

  <tbody>
    <tr dir-paginate="v ...">
      <td class="td-values1">
        <input type="text" class="form-control" placeholder="//News Titel" ng-model="v.srctitel" ng-readonly='v.srctitel'></input>
        <textarea ui-tinymce='tinymceOptionsRead' ng-model='v.srcnews'></textarea>
      </td>
      <td class="td-values1">
        <input type="text" class="form-control" placeholder="//News Titel" ng-model="v.tartitel"></input>
        <textarea ui-tinymce='tinymceOptions' ng-model='v.tarnews' data-section='{{v.tarid}}' data-section2='{{v.tartitel}}'></textarea>
      </span>
      </td>

Ive tried out and changed the second TinyMce to 'tinyMceOptionsRead' and first to 'tinyMceOptions' but the behavior was the same that in the second TableData row some Editors were not generated. So the Problem does not lies in the Configuration of the TinyMces? To be sure I post the Code as well

  initTiny(){
          this.$scope.tinymceOptions = {//For Edits
            menubar: false,
            theme: 'modern',
            plugins: 'save link ',
            save_enablewhendirty: false,
            toolbar: ' undo redo | styleselect | fontsizeselect | save | link | bullist numlist |',
            fontsize_formats: '8pt 10pt 12pt 14pt 18pt 24pt 36pt',
            statusbar: false,
            height: 130,
            save_onsavecallback: (editor) => {
             ...
            },
          };
          this.$scope.tinymceOptionsRead = {//Readonly
            menubar: false,
            theme: 'modern',
            plugins: '',
            toolbar: false,
            readonly: true,
            statusbar: false,
            height: 170,
          };
        }

If I comment the first TinyMce out it works Perfectly. Is it a Problem with AngularJs ng-repeat?

1

There are 1 best solutions below

0
On BEST ANSWER

By further Inspection Ive found that it set the ID of the generated TinyMce sometimes the same as previous one Generated.

This was a Bug coming from the Angular Package angular-ui-tinymce and got resolved in Version 0.0.18
https://github.com/angular-ui/ui-tinymce/issues/310