title: Extend bootstrap select plugin
body: <p>In my previous question I was talking about the bootstrap select plugin where the destroy method is doing something that I don't want. I edit manually the plugin but this is not a good practice.</p>
  
  <p><a href="https://stackoverflow.com/questions/27333816/bootstrap-select-destroy-removes-the-original-select-from-dom/27334086?noredirect=1#comment43125298_27334086">Bootstrap select destroy removes the original select from DOM</a></p>
  
  <p>I would like to extend the plugin with a custom method so that it can do exactly wat I want.</p>
  
  <p>I extend the plugin with folloing method:</p>
  
  <pre><code>$.extend(true, $.fn.selectpicker.prototype, {
      customRemove: function () {
          this.$newElement.remove();
          this.$element.show();
      }
  });
  </code></pre>
  
  <p>This is located in another js file under the bootstrap select script file.</p>
  
  <p>How do I call this new method? I tried the following without success:</p>
  
  <pre><code>$('select#begin' + _week + _day).selectpicker("customRemove");
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$('select#begin' + _week + _day).selectpicker().customRemove();
  </code></pre>
  
  <p>Am I missing something?</p>
  
  <p>The original method of the destroy function in the bootstrap select plugin:</p>
  
  <pre><code>remove: function () {
    this.$newElement.remove();
    this.$element.show();
  }
  </code></pre>