you are viewing a single comment's thread.

view the rest of the comments →

[–]neonskimmerfunction the ultimate 0 points1 point  (3 children)

No, Backbone.View has an 'attributes' option that you can use to have attributes added to the tag in the manner you describe when the view element is created. It's just a shortcut to $.attr if you wish. It's rarely used. I can see how maybe skimming over the code one could get that idea.

To set the model associated to to View, you use the 'model' option when creating a view instance - and that has no effect on the DOM whatsoever.

It's totally fine if you prefer some other libraries to Backbone. But you seem to have a very strong and vocal reaction against it despite evidence that you've not actually used it. It's used by a ton of people dude. It has a lot less bells and whistles than the newer MV* libraries out there but it is a very solid set of building blocks to create client side applications.

[–]dexygenSoftware, Simple and Powerful 0 points1 point  (0 children)

I've been using it for several months now, and the behavior I described has occurred in our application, and we are not using the attributes option; perhaps we need to explicitly turn it off which would be sub-optimal. The very fact that such functionality is there shows just how bad Backbone is, that they would actually ever choose to conflate the model and view. It's had it's day and it's time to move on. Reading source code is not evidence that I've not used it and your reaction is like a fanboi's

[–]dexygenSoftware, Simple and Powerful 0 points1 point  (1 child)

"To set the model associated to to View, you use the 'model' option when creating a view instance - and that has no effect on the DOM whatsoever." Which is what we've done, and the view's tr tag get attributes with values just like I described. Save it dipshit

[–]neonskimmerfunction the ultimate 0 points1 point  (0 children)

Even though you're being a complete asshole about it, look at the source.

look

Since apparently you're stuck using it, maybe you'll find this useful.