How can I check if a Backbone.View is currently rendered in DOM?

I would like to check if a Backbone.View is currently rendered in the DOM if not I don't have to rerender it. Can I check this somehow?

Regards

Answers


Well, in theory you could query the DOM to find out, but that will be a lot slower than just setting an instance variable and querying that before rendering. On the other hand, the render method (assuming everything is set up correctly) should only be called when the model changes, so your question indicates that you are probably not using the View according to how it is supposed to be used (MVC style). But assuming you need to do this, setting a this.rendered = true and checking that before rendering again in your render method is probably the fastest and easiest.


Need Your Help

Video Editing in Iphone

iphone video editing trim

In my application user should be able to select a video from video library and also should able to trim the video and play the video in a movie player. Can any one please help me???

Operator overloading c++ advice

c++ operators operator-overloading

I am struggling to get my head around operator overloading. In this case the + operator I have and example of what I have tried, any help would be greatly appreciated.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.