title: WP Editor - wp_editor() is not showing properly on ajax call
body: <p>I'm creating a WordPress plugin. It has a functionality to show the editor when adding a product through AJAX but the the editor is not showing properly.</p>
  
  <p>User can add as many products as he want so keep in mind that there will be more than one wp_editor()</p>
  
  <p>Please refer to the attached screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/OEUXz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/OEUXz.png" alt="enter image description here"></a></p>
  
  <p>I have used the following code:</p>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>public function add_product() {
  
          // Get product id
          $prod_id = filter_input(INPUT_POST, 'pid');
  
          // WordPress WYSIWYG Editor
          wp_editor("Test Content", "textarea" . $prod_id, array('textarea_name' =&gt; 'text'));
          wp_die();
  }
  </code></pre>
  
  <p><strong>JQUERY</strong></p>
  
  <pre><code>$('.add-prod').live('click', function () {
  
          var prod_id = $('.prod-id').val();
          var data = {
              action: 'add_prod',
              pid: prod_id
          };
          $('#update-msg').show();
  
          $.post(ajaxurl, data, function (result) {
              $('#the-list').append(result);
              $('#update-msg').hide();
          });
  
          return false;
  });
  </code></pre>
  
  <p>I have used a solution from the internet but its partially working not fully. Used the following code:</p>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>wp_editor($product-&gt;prod_desc, $textarea_id, array('textarea_name' =&gt; 'text'));
  \_WP_Editors::enqueue_scripts();
  print_footer_scripts();
  \_WP_Editors::editor_js();
  </code></pre>
  
  <p><strong>JQUERY</strong></p>
  
  <pre><code>var eid = '#item-list';
  switchEditors.go(eid, 'tmce')
  quicktags({id: eid});
  //init tinymce
  tinyMCEPreInit.mceInit[eid]['elements'] = eid;
  tinyMCEPreInit.mceInit[eid]['body_class'] = eid;
  tinyMCEPreInit.mceInit[eid]['succesful'] = false;
  tinymce.init(tinyMCEPreInit.mceInit[eid]);
  </code></pre>
  
  <p>And the code above does this:</p>
  
  <p><a href="https://i.stack.imgur.com/6oEfh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6oEfh.png" alt="enter image description here"></a></p>