
define([
	'marionette',
	'app',
	'text!module/account/template/modifyAccount.html'
], function(Marionette, App, ModifyAccountTemplate)
{
	var ModifyAccountView = Marionette.ItemView.extend(
	{
		template: ModifyAccountTemplate,

		events: {
			'blur #account-firstname': 'actionSave',
			'blur #account-lastname': 'actionSave',
		},

		ui: {
			firstname: '#account-firstname',
			lastname: '#account-lastname'
		},

		actionSave: function (event)
		{
			App.vent.trigger('account:save', this.model);
		}
	});

	return ModifyAccountView;
});


define([
	'marionette',
	'marionette.formview',
	'text!module/account/template/modifyAccount.html'
], function(Marionette, MarionetteFormView, ModifyAccountTemplate)
{
	var ModifyAccountView = Marionette.FormView.extend(
	{
		template: ModifyAccountTemplate,

		/**
		 * Save model when submit me
		 */
		onSubmit: function (evt)
		{
			evt.preventDefault();

			this.model.set(this.serializeFormData()).savedata();
		},
	});

	return ModifyAccountView;
});

Save data when clicking to save button
Save data when clicking to save button
