examples/blog/public/components/blog.js
function (event) {
      var id = event.target.parentNode.getAttribute('data-id');
      // By getting collection through this.state you get an hash of the collection
      this.setState(_.findWhere(this.state.collection, {id: id}));
    }
function (event) {
      var id = event.target.parentNode.getAttribute('data-id');
      // By getting collection through this.state you get an hash of the collection
      this.setState(_.findWhere(this.state.collection, {id: id}));
    }
function ( event ) { var id = event . target . parentNode . getAttribute ( 'data-id' ) ; // By getting collection through this.state you get an hash of the collection this . setState ( _ . findWhere ( this . state . collection , { id : id } ) ) ; }
Getting the id of the post that triggered the edit button and passing the respective model into this.state.
Getting the id of the post that triggered the edit button and passing the respective model into this . state .