Skip to content

Instantly share code, notes, and snippets.

@umar-webonise
Created April 10, 2015 10:10
Show Gist options
  • Save umar-webonise/8d5921b1892a3bff0931 to your computer and use it in GitHub Desktop.
Save umar-webonise/8d5921b1892a3bff0931 to your computer and use it in GitHub Desktop.
Multi select drop down with tree indentation
<div class="control labelMove bottomSpace4">
<select
id="org_node"
name="orgNode"
class="chosen-select"
chosen="treeDropOptions"
required
ng-model="indicator.org_node_id">
<option ng-repeat="opt in treeDropOptions" ng-value="opt.id">
{{Array(opt.lvl * 7).join("&nbsp;")}} {{opt.name}}
</option>
</select>
<label for="org_node">Org Node</label>
</div>
<script>
$http.get("/org_nodes/org_tree.json").success(function (tree) {
var array = [];
$scope.Array = Array;
Utils.treeToArray( tree, array);
$scope.treeDropOptions = array;
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment