LIDOR SYSTEMS

Advanced User Interface Controls and Components

IntegralUI Web

Native Angular 4 and AngularJS UI Components


TreeView / Multiple Item Selection








A demonstration of different selection types available in TreeView directive for AngularJS. By clicking on check box on the right, you can change the built-in property:

  • selectionMode - determines how many items can be selected at the same time and also changes the selection process

There are four acceptable values:

  • 'none' - selection is disabled
  • 'one' - Only one item can be selected
  • 'multi-simple' - Multiple items can be selected using mouse clicks or keyboard keys
  • 'multi-extended' - Multiple items can be selected using mouse clicks or keyboard keys, including the SHIFT key

In multi-selection mode, items can become selected using the CTRL key or Arrow keys. Furthermore by pressing the CTRL+SPACE keys, you can select/deselect items. The 'multi-extended' mode allows selection of multiple items in wide range. While SHIFT key is pressed, all items from first to last clicked item will become selected.

<!DOCTYPE html>

<html>

<head>

<link rel="stylesheet" href="css/integralui.css" />

<link rel="stylesheet" href="css/integralui.treeview.css" />

<link rel="stylesheet" href="css/themes/theme-blue.css" />

<script type="text/javascript" src="external/angular.min.js"></script>

<script type="text/javascript" src="js/angular.integralui.min.js"></script>

<script type="text/javascript" src="js/angular.integralui.lists.min.js"></script>

<script type="text/javascript" src="js/angular.integralui.treeview.min.js"></script>

</head>

<body>

<div ng-app="appModule" ng-controller="appCtrl">

<iui-treeview name="{{treeName}}" items="data" selection-mode="{{selMode}}" tabindex="0"></iui-treeview>

<div>

<label>Choose Selection Type</label><br /><br />

<label><input type="radio" ng-model="selMode" value="none" />None</label><br />

<label><input type="radio" ng-model="selMode" value="one" />One</label><br />

<label><input type="radio" ng-model="selMode" value="multi-simple" />Multi-Simple</label><br />

<label><input type="radio" ng-model="selMode" value="multi-extended" />Multi-Extended</label><br />

</div>

</div>

</body>

</html>

angular

.module("appModule", ["integralui"])

.controller("appCtrl", function($scope){

$scope.treeName = "treeSample";

$scope.selMode = 'one';

 

$scope.data = [

{

id: 1,

text: "Item1",

items: [

{ id: 11, pid: 1, text: "Item11" },

{

id: 12,

pid: 1,

text: "Item12",

items: [

{ id: 121, pid: 12, text: "Item121" },

{

id: 122,

pid: 12,

text: "Item122",

expanded: false,

items: [

{ id: 1221, pid: 122, text: "Item1221" },

{ id: 1222, pid: 122, text: "Item1222" }

]

},

{ id: 123, pid: 12, text: "Item123" },

{ id: 124, pid: 12, text: "Item124" },

{ id: 125, pid: 12, text: "Item125" }

]

},

{ id: 13, pid: 1, text: "Item13" },

{

id: 14,

pid: 1,

text: "Item14",

items: [

{ id: 141, pid: 14, text: "Item141" },

{ id: 142, pid: 14, text: "Item142" }

]

}

]

},

{

id: 2,

text: "Item2",

expanded: false,

items: [

{ id: 21, pid: 2, text: "Item21" },

{ id: 22, pid: 2, text: "Item22" },

{

id: 23,

pid: 2,

text: "Item23",

expanded: false,

items: [

{ id: 231, pid: 23, text: "Item231" },

{ id: 232, pid: 23, text: "Item232" }

]

}

]

},

{ id: 3, text: "Item3" },

{ id: 4, text: "Item4" },

{ id: 5, text: "Item5" },

{

id: 6,

text: "Item6",

items: [

{ id: 61, pid: 6, text: "Item61" },

{ id: 62, pid: 6, text: "Item62" }

]

},

{ id: 7, text: "Item7" }

];

});