diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbtable.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbtable.directive.js index 17d4dd93ff..c45a9f78e5 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbtable.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbtable.directive.js @@ -1,3 +1,114 @@ +/** +@ngdoc directive +@name umbraco.directives.directive:umbTable +@restrict E +@scope + +@description +Added in Umbraco v. 7.4: Use this directive to render a data table. + +

Markup example

+
+    
+ + + + +
+
+ +

Controller example

+
+    (function () {
+        "use strict";
+    
+        function Controller() {
+    
+            var vm = this;
+    
+            vm.items = [
+                {
+                    "icon": "icon-document",
+                    "name": "My node 1",
+                    "published": true,
+                    "description": "A short description of my node",
+                    "author": "Author 1"
+                },
+                {
+                    "icon": "icon-document",
+                    "name": "My node 2",
+                    "published": true,
+                    "description": "A short description of my node",
+                    "author": "Author 2"
+                }
+            ];
+
+            vm.options = {
+                includeProperties: [
+                    { alias: "description", header: "Description" },
+                    { alias: "author", header: "Author" }
+                ]
+            };
+    
+            vm.selectItem = selectItem;
+            vm.clickItem = clickItem;
+            vm.selectAll = selectAll;
+            vm.isSelectedAll = isSelectedAll;
+            vm.isSortDirection = isSortDirection;
+            vm.sort = sort;
+
+            function selectAll($event) {
+                alert("select all");
+            }
+
+            function isSelectedAll() {
+                
+            }
+    
+            function clickItem(item) {
+                alert("click node");
+            }
+
+            function selectItem(selectedItem, $index, $event) {
+                alert("select node");
+            }
+            
+            function isSortDirection(col, direction) {
+                
+            }
+            
+            function sort(field, allow, isSystem) {
+                
+            }
+    
+        }
+    
+        angular.module("umbraco").controller("My.TableController", Controller);
+    
+    })();
+
+ +@param {string} icon (binding): The node icon. +@param {string} name (binding): The node name. +@param {string} published (binding): The node published state. +@param {function} onSelect (expression): Callback function when the row is selected. +@param {function} onClick (expression): Callback function when the "Name" column link is clicked. +@param {function} onSelectAll (expression): Callback function when selecting all items. +@param {function} onSelectedAll (expression): Callback function when all items are selected. +@param {function} onSortingDirection (expression): Callback function when sorting direction is changed. +@param {function} onSort (expression): Callback function when sorting items. +**/ + (function () { 'use strict';