Tuesday 15 March 2011

javascript - Backbone - Get model's idAttribute value from the collection? -


I am creating a generic table view which can be used with different collections here which I am trying to do I'm an example of this:

  ... getModelIdAttribute: function () {this.collection return .__ proto ___ model.prototype.idAttribute; }, GetModelFromRow: function (HTMLrow) {this.collection.get Return (this.dataTable.row (HTMLrow) .data () [this.getModelIdAttribute ()]); }, ...  

data () function returns an object with the attributes used to create the model, but I have different idAttributes.

Currently, my method works - but __proto __ dislikes and it seems that I should be an easy way to remember?

thanks


No comments:

Post a Comment