EvHaus / doby-grid

An HTML table element on steroids.
Other
14 stars 5 forks source link

Bug causes listeners to be registered many times #127

Open ckosmowski opened 10 years ago

ckosmowski commented 10 years ago

Steps to reproduce:

This is because of two different callstacks:

1.) initialize() -> validateOptions() -> bindToCollection() 2.) setOptions() -> validateOptions() -> bindToCollection()

Took me hours to find out why the add method is called twice with the exact same callstack. Can you fix this or give us a hint on how you want this to be fixed?

EvHaus commented 10 years ago

Thanks for tracking that down. That's a serious issue. Not sure what the right solution is yet, will have to do a code review.

ckosmowski commented 10 years ago

My quickfix was to add self.stopListening(self.options.data); as the first line of bindToCollection()