|
@@ -31,18 +31,27 @@ angular.module('luticateUtils')
|
31
|
31
|
{
|
32
|
32
|
}
|
33
|
33
|
}
|
34
|
|
- var onItemClicked = $scope.tableOptions.onItemClicked;
|
35
|
|
- $scope.tableOptions.onItemClicked = function (item) {
|
36
|
|
- if (onItemClicked != null) {
|
37
|
|
- onItemClicked(item);
|
|
34
|
+ if ($scope.tableOptions.onItemClicked == null) {
|
|
35
|
+ $scope.tableOptions.onItemClicked = function (item) {
|
|
36
|
+ var ctrl = $scope.tableOptions.getEditController();
|
|
37
|
+ dialogs.create('views/modals/' + ctrl.toLowerCase() + '.html', ctrl + 'Controller', item)
|
|
38
|
+ .result.then(function (data) {
|
|
39
|
+ $scope.tableOptions.luBasicTableScope.loadPage($scope.tableOptions.page);
|
|
40
|
+ $scope.tableOptions.onItemEdited(data);
|
|
41
|
+ });
|
|
42
|
+ };
|
|
43
|
+ }
|
|
44
|
+ if ($scope.tableOptions.addItem == null) {
|
|
45
|
+ $scope.tableOptions.addItem = function()
|
|
46
|
+ {
|
|
47
|
+ var ctrl = $scope.tableOptions.getEditController();
|
|
48
|
+ dialogs.create('views/modals/' + ctrl.toLowerCase() + '.html', ctrl + 'Controller', $scope.tableOptions.editData)
|
|
49
|
+ .result.then(function (data) {
|
|
50
|
+ $scope.tableOptions.luBasicTableScope.loadPage($scope.tableOptions.page);
|
|
51
|
+ $scope.tableOptions.onItemAdded(data);
|
|
52
|
+ });
|
38
|
53
|
}
|
39
|
|
- var ctrl = $scope.tableOptions.getEditController();
|
40
|
|
- dialogs.create('views/modals/' + ctrl.toLowerCase() + '.html', ctrl + 'Controller', item)
|
41
|
|
- .result.then(function (data) {
|
42
|
|
- $scope.tableOptions.luBasicTableScope.loadPage($scope.tableOptions.page);
|
43
|
|
- $scope.tableOptions.onItemEdited(data);
|
44
|
|
- });
|
45
|
|
- };
|
|
54
|
+ }
|
46
|
55
|
|
47
|
56
|
|
48
|
57
|
if ($scope.tableOptions.canDel == null) {
|
|
@@ -113,15 +122,6 @@ angular.module('luticateUtils')
|
113
|
122
|
});
|
114
|
123
|
});
|
115
|
124
|
};
|
116
|
|
-
|
117
|
|
- $scope.addItem = function () {
|
118
|
|
- var ctrl = $scope.tableOptions.getEditController();
|
119
|
|
- dialogs.create('views/modals/' + ctrl.toLowerCase() + '.html', ctrl + 'Controller', null)
|
120
|
|
- .result.then(function (data) {
|
121
|
|
- $scope.tableOptions.luBasicTableScope.loadPage($scope.tableOptions.page);
|
122
|
|
- $scope.tableOptions.onItemAdded(data);
|
123
|
|
- });
|
124
|
|
- };
|
125
|
125
|
}
|
126
|
126
|
};
|
127
|
127
|
}
|
|
@@ -136,7 +136,7 @@ angular.module('luticateUtils').run(['$templateCache', function($templateCache)
|
136
|
136
|
'ng-disabled="tableOptions.checkedItems.length == 0" ng-show="tableOptions.canDel()">' +
|
137
|
137
|
' <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete' +
|
138
|
138
|
' </button>' +
|
139
|
|
-' <button class="btn btn-default" type="button" ng-click="addItem()" ng-show="tableOptions.canAdd()">' +
|
|
139
|
+' <button class="btn btn-default" type="button" ng-click="tableOptions.addItem()" ng-show="tableOptions.canAdd()">' +
|
140
|
140
|
' <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add' +
|
141
|
141
|
' </button>' +
|
142
|
142
|
' </div>');
|