How To Move Data Between Two Multiselects

Posted By Vitaliy | April 22, 2012 | ExtJS 4.0.7
0 3692
Reply to thread
Drag-and-Drop version here

Js Code

{
	itemId: 'toright',
	text: '>',
	handler: function () {
		var form = this.up('form');
		var values = form.down('#left').getValue();
		if (values.length) {
			var left = form.down('#left').store;
			var right = form.down('#right').store;
			var record;
			Ext.Array.each(values, function (v) {
				record = left.findRecord('text', v);
				left.remove(record);
				right.add({ text: v });
			});
		}
	}
}