javascript - Getting undefine trying to get the ObjectId of a Collection -


i'm making voting system message board app using backbone. problem here when try objectid of object , set "rel" attribute in tag attribute set "undefined" .

<% if(models.length>0) {                     _.each(models, function(value, key, list) {%>                     <tr>                         <td><%= value.attributes.username %></td>                         <td><%= value.attributes.message %></td>                         <td>                             <table>                                 <tr>                                     <td><a id="voteup" class="btn btn-default btn-sm" rel="<%= value.attributes.objectid%> "><img width="30" src="img/appbar.thumbs.up.png"/></a></td>                                     <td width="30">                                         +<%= value.attributes.thumbsup %>                                     </td>                                     <td>                                         <a id="votedown" class="btn btn-default btn-sm" rel=" <%= value.attributes.objectid %> "><img width="30" src="img/appbar.thumbs.down.png"/></a>                                     </td>                                     <td width="30">                                         -<%= value.attributes.thumbsdown %>                                     </td>                                 </tr>                             </table>                         </td>                      </tr>                     <%  });  

in db on parse objectid show can access username, message, thumbsup, thumbsdown.

here jsfiddle complete home.html , app.js

i think should debug backbone/parse collection layer , first determine type reference dealing with??

attributes or objects @ level of entries in backbone collection

the answer determines how backbone unwrap individual collection entries.

note this thread remembering parse referents can little finicky regarding valueof(objectid).

if getting other field values ok target class , objectid 1 bug, issue.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -