Ladislav Maxa Ladislav Maxa - 3 months ago 7x
Javascript Question

How to get model property in className of ItemView?

I my app I need to render ul of users with their ids in class attribute of li. S I tried to do it like this:

tagName: 'li',
className: this.model.get('user_id'),
template: userTpl

But it didn't work. Is it possible to achieve this some other way?

Vic Vic

can't you do something like this?

className: function(){
  return this.model.get('user_id');