I have two multi-select lists that have objects that can move between the two. I would like to show visually the movement/flow of items when they are moving from two multi-select lists.
The two lists are side by side. (One on the right and one on left)
If I move x number of objects from the right to the left, I want the background color to be red (showing removal) for those objects. If objects move from left to right, they are added so should be green. The ones that do not move should stay white background.
How can I go about this?
<div>
<label>Current Keywords:</label>
<div>
<select multiple size="8" ng-model="selectedCurr" ng-options="keyword in selectedKeywords"></select>
</div>
</div>
<div>
<input id="moveRight" type="button" value=">" ng-click="moveItem(selectedCurr, selectedKeywords, availableKeywords)"/>
<input id="moveLeft" type="button" value="<" ng-click="moveItem(selectedAvailable, availableKeywords, selectedKeywords)"/>
</div>
<div>
<label>Available Keywords:</label>
<div>
<select multiple size="8" ng-model="selectedAvailable" ng-options="keyword in availableKeywords"></select>
</div>
</div>
$scope.moveItem = function(items, from, to) {
angular.forEach(items, function(item) {
var idx = from.indexOf(item);
from.splice(idx, 1);
to.push(item);
});
$scope.selectedCurrent = [];
$scope.selectedAvailable = [];
};