Extending objects with JQuery, Object has no method error
<p>I have this javascript code:</p>

<pre><code>var TodoController = {

  init: function() {

    $(this).find('input.todo_check').click(function(){
      $(this).parents('li.todo').done();
    });

  }    
}

var Todo = {
  done: function() {
    $(this).toggleClass('done');
  }
}

$(document).ready(function() {

  $("li.todo").extend(Todo);  
  $("#todo_list").extend(TodoController).init();

});
</code></pre>

<p>When I click on a 'input.todo_check' I expect done() function, on 'li.todo', to be executed. But I get:</p>

<p>=> Uncaught TypeError: Object [object Object] has no method 'done'</p>

<p>What I'm doing wrong? </p>

<p>This statement should add 'done()' function to "li.todo" elements?:</p>

<pre><code>$("li.todo").extend(Todo);  
</code></pre>

<p>Thanks.
JM</p>
