瀏覽代碼

lu tbale override select item

tags/0.1.0
Robin Thoni 9 年之前
父節點
當前提交
d1a139294b
共有 1 個檔案被更改,包括 15 行新增7 行删除
  1. 15
    7
      src/lutable.js

+ 15
- 7
src/lutable.js 查看文件

@@ -44,13 +44,21 @@ angular.module('luticateUtils')
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 63
                     $scope.removeItems = function () {
56 64
                         if ($scope.selectedItems.length == 0) {

Loading…
取消
儲存