MVC - Where does extra data generated just for the UI get stored?
We are building a Silverlight app and using PureMVC but the technology and framework probably aren't that important to this question.
We have a view that contains a grid and that grid is bound to a model. However, we have additional columns of data that we would like to display for the user but the data is derived and not stored in the model.
Where is the best place within MVC to handle this?
Any help or suggest开发者_StackOverflow社区ions would greatly be appreciated!
Thanks a lot,
Bobby
Add properties to your model object for the additional columns then wire up the logic behind them in their property gets and bind them to the grid as additional columns.
From a 'patterns' approach, do not change your model (unless your model already is purposed as a ViewModel. Implement a specific view model in this case. A view model should have view logic (additional columns, code specific to the model layout, etc) a plain model should not.
精彩评论