Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

model idAttribute does not work because "id" is hardcoded in DropdownListView.render #1

Open
DougLeary opened this issue Oct 18, 2016 · 0 comments

Comments

@DougLeary
Copy link

DropdownListView.render() fails if the model's id property is not called "id".
The following change fixes this by using the model's idAttribute instead of literal "id":

 render: function() {
     var html = this.collection.reduce(function(str, model) {
  •        return str + "<li data-id=\""+ model.get("id") +"\">"+ model.get(this.title_field) +"</li>";
    
  •       return str + "<li data-id=\""+ model.id +"\">"+ model.get(this.title_field) +"</li>";
     }, "", this);
    
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant