title: How to extend a jquery ui widget ? (1.7)
body: <p>I would like to create a custom version of the sortable widget. I have been searching for documentation, but could not find something really accurate. The best information I found was : <a href="http://jqueryui.pbworks.com/Widget-factory" rel="noreferrer">http://jqueryui.pbworks.com/Widget-factory</a>.</p>
  
  <p>I tried :</p>
  
  <pre><code>$.widget("ui.customsortable", $.extend($.ui.sortable, {
    _init: function() {
      $.widget.prototype._init.apply(this, arguments);
    }
  }));
  </code></pre>
  
  <p>But $.widget.prototype._init is not the function I want to call I guess since it is the $.widget prototype.</p>
  
  <p>Then, I tried something I read here and there :</p>
  
  <pre><code>var _init = $.ui.sortable.prototype._init; 
  
  $.widget("ui.customsortable", $.extend($.ui.sortable, {
    _init: function() {
      _init.apply(this, arguments);
    },
  }));
  </code></pre>
  
  <p>But :</p>
  
  <ul>
  <li>I can't believe I have to store all methods I want to override like this, it is so ugly.</li>
  <li>It throws an error ("this.refresh is not a function"), which means the refresh method does not exist. Does that mean I would have to recreate all methods I want to override ? What's the point of extending in that case ?</li>
  </ul>
  
  <p>Am I missing something here ?</p>
  
  <p>Thanks for your help !</p>