{"issue":{"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"state":"open","user":{"avatar_url":"https://secure.gravatar.com/avatar/f9738fef802fd0ea3502a0e7cb3dbea6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"f9738fef802fd0ea3502a0e7cb3dbea6","url":"https://api.github.com/users/burin","login":"burin","id":24559},"milestone":null,"assignee":null,"labels":[],"updated_at":"2011-10-31T17:01:59Z","comments":0,"closed_at":null,"url":"https://api.github.com/repos/powmedia/backbone-forms/issues/18","body":"When calling `commit()` on a form with more than one updated field, `change` is triggered on the associated model for each changed attribute.\r\n\r\nBackbone allows you to `set()` many attributes at once on a `model`. I think this triggers one `change` event, even when more than one attribute is updated. This allows you to listen to the `change` event on a model and fire a function.\r\n\r\nShould we build a hash of attributes to change and set them all at once in the  `commit()` vs once per field?\r\n\r\nMy current use case is having a `SearchForm` with an associated `SearchRequestModel`. A `ResultsCollection` references an instance of the `SearchRequestModel` and has a function bound to the `change` event that calls a `fetch`, using the `SearchRequestModel`'s attributes as the parameters to send in the `fetch`. \r\n\r\nBasically, when \"submitting\" the form, I call `commit()` on the `form`, triggering the `change` on the request `model`, which triggers the `collection`'s `fetch`.","html_url":"https://github.com/powmedia/backbone-forms/issues/18","title":"Allow form.commit() to trigger only one change event on model","number":18,"id":2099286,"created_at":"2011-10-31T17:01:59Z"},"action":"opened"}