walmartlabs/thorax — pull request #163 by blakeembrey (2013-05-27 06:06:33+00:00)
Title: View render now keeps track of user input

Working on fixing #114.

This updates the render function to keep track of input data when populate and render has previously been called. Blocks both the `populate` and `serialize` events from emitting while the view is rendering (though this could be an option passed in if that fits better).

The current behaviour for this PR is for the form data to be serialised and filtered for non-empty inputs. This is then merged with the current model state which allows new properties to be defined on the model and render to add the extra property to the form. Also moves the end rendering flag to below the input populating.

Not sure about the merging behaviour, doesn't seem to fit properly. Thinking that either we should just use the user data without merging new data - or that populate should be update to serialise and merge when no attributes are passed in. Any suggestions?