문제

How do you add extra fields into todo.js?

  initialize: function() {
  this.input    = this.$("#new-todo");
  Todos.bind('add',   this.addOne, this);
  Todos.bind('reset', this.addAll, this);
  Todos.bind('all',   this.render, this);

  Todos.fetch();
},

i think its the above code thats troubling, #new-todo is the div id where the text field is.

i add another 'this.input' with the id of the new field but it doesn't pick it up. how do i add additional elements?

도움이 되었습니까?

해결책

I think this.$ only search beneath the element connected to the view. If you have your input element outside of the element the view is connected to, you can try to use just $("#another-todo") or similar.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top