tag:blogger.com,1999:blog-581197352358126527.post2204717273802264074..comments2024-03-28T00:32:25.959-07:00Comments on japh(r) by Chris Strom: Duplicate Backbone Events with jQuery UI DialogsAnonymoushttp://www.blogger.com/profile/00135361916531185929noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-581197352358126527.post-50880915392265250392011-09-26T06:24:34.868-07:002011-09-26T06:24:34.868-07:00If you are using the same view over and over, you ...If you are using the same view over and over, you should only initialize it once, and use the "el" parameter of backbone to bind it to a single dom id element.<br /><br />Then only call initialize once, and render once. Then make a method called "reset" that clears the form. Then when you need to add a new event, the click handler to open the dialog calls reset then shows the dialog.<br /><br />It's like a Singleton for a View (see my drafted chapter entitled Singleton Views :-D). We should probably put an example like this in that chapter.Anonymoushttps://www.blogger.com/profile/14680901673800390862noreply@blogger.com