jQuery( document ).ready( function() {
	jQuery('#collectionTarget2').collections( {
		template: jQuery('#collectionTemplate2'),
		//	Initial data
		data: [
			{ id: 1, name: 'David Lann', customerType: 'v', order: '1' },
			{ id: 2, name: 'Jill Jones', customerType: 'n', spam: 'true', order: '2' }
		],
		addButton: jQuery('#addButton2'),
		deleteButtonName: 'deleteButton',
		beforeAdd: function( data, args ) {
			//	Set the order, using the collection count
			var collectionCount = parseInt( jQuery( args.addButton ).attr( 'collectionCount' ), 10 );
			data['order'] = data['order'] || collectionCount;
			return data;
		},
		bindings: {
			//	Move up collection, freezing the order field values; you could
			//	optionally freeze other fields here
			'moveUpButton': {
				event: 'click',
				func: function( e, collection ) {
					jQuery.fn.moveUpCollection( collection, ['order'] );
				} 
			},
			//	Move down collection, freezing the order field values
			'moveDownButton': {
				event: 'click',
				func: function( e, collection ) {
					jQuery.fn.moveDownCollection( collection, ['order'] );
				} 
			}
		}
	} );
} );