Browse Source

lu tbale override select item

tags/0.1.0
Robin Thoni 9 years ago
parent
commit
d1a139294b
1 changed files with 15 additions and 7 deletions
  1. 15
    7
      src/lutable.js

+ 15
- 7
src/lutable.js View File

44
                             });
44
                             });
45
                     };
45
                     };
46
 
46
 
47
-                    $scope.displayItem = function (item) {
48
-                        var ctrl = $scope.tableOptions.getEditController();
49
-                        dialogs.create('views/modals/' + ctrl.toLowerCase() + '.html', ctrl + 'Controller', item)
50
-                            .result.then(function (data) {
51
-                                $scope.loadPage($scope.page);
52
-                            });
53
-                    };
47
+                    if ($scope.tableOptions.displayItem != null){
48
+                        $scope.displayItem = function(item)
49
+                        {
50
+                            return $scope.tableOptions.displayItem(item, $scope);
51
+                        };
52
+                    }
53
+                    else {
54
+                        $scope.displayItem = function (item) {
55
+                            var ctrl = $scope.tableOptions.getEditController();
56
+                            dialogs.create('views/modals/' + ctrl.toLowerCase() + '.html', ctrl + 'Controller', item)
57
+                                .result.then(function (data) {
58
+                                    $scope.loadPage($scope.page);
59
+                                });
60
+                        };
61
+                    }
54
 
62
 
55
                     $scope.removeItems = function () {
63
                     $scope.removeItems = function () {
56
                         if ($scope.selectedItems.length == 0) {
64
                         if ($scope.selectedItems.length == 0) {

Loading…
Cancel
Save