Skip to content

Commit 01f065d

Browse files
Merge pull request #31 from takenet/feature/146441-adding-action-to-table
feat(component): adding action to blip table
2 parents 9d633cb + 00a71bd commit 01f065d

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/components/blipTable/BlipTableView.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
</div>
2929
</div>
3030
</th>
31+
<th ng-if="$ctrl.tableAction" class="action-icon">
32+
</th>
3133

3234
<div ng-transclude></div>
3335
</tr>
@@ -46,7 +48,7 @@
4648
</colgroup>
4749

4850
<tbody>
49-
<tr ng-repeat="item in $ctrl.tableData track by $index" ng-class="{'checked': item.checked}">
51+
<tr ng-repeat="item in $ctrl.tableData track by $index" ng-class="{'checked': item.checked, 'hasTableAction': $ctrl.tableAction}">
5052
<td class="tc adjust" ng-if="$ctrl.selectable">
5153
<div class="flex items-center justify-center">
5254
<blip-checkbox
@@ -59,6 +61,9 @@
5961
<td class="{{column.rowClass}}" ng-repeat="column in $ctrl.columns" title="{{item[column.rowTitle]}}">
6062
{{item[column.rowParam]}}
6163
</td>
64+
<td class="action-icon td-action-icon" ng-if="$ctrl.tableAction">
65+
<img icon-src="ArrowRight" ng-click="$ctrl.tableAction(item)"></img>
66+
</td>
6267
</tr>
6368
</tbody>
6469

src/components/blipTable/blipTable.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export class BlipTableController {
2929
public scrollable: boolean;
3030
public selectable: boolean;
3131
public allChecked: boolean;
32+
public tableAction: any;
3233
public selected: any[];
3334

3435
constructor(
@@ -131,6 +132,7 @@ export const BlipTableComponent = angular
131132
template,
132133
bindings: {
133134
tableData: '<',
135+
tableAction: '<?',
134136
},
135137
transclude: true,
136138
})

0 commit comments

Comments
 (0)