Skip to content

Commit b5807d8

Browse files
committed
pfTableView: refactor column 'colHeader' & 'colItemFld' to 'header' and 'itemField'
1 parent 83b0995 commit b5807d8

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

src/table/tableview/examples/table-view-basic.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* @param {array} items Array of items to display in the table view.
1717
* @param {array} columns Array of table column information to display in the table's header row
1818
* <ul style='list-style-type: none'>
19-
* <li>.colHeader - (string) Text label for a column header
20-
* <li>.colItemFld - (string) Item field to associate with a particular column.
19+
* <li>.header - (string) Text label for a column header
20+
* <li>.itemField - (string) Item field to associate with a particular column.
2121
* </ul>
2222
* @param {array} actionButtons List of action buttons in each row
2323
* <ul style='list-style-type: none'>
@@ -62,10 +62,10 @@
6262
};
6363
6464
$scope.colummns = [
65-
{ colHeader: "Name", colItemFld: "name" },
66-
{ colHeader: "Address", colItemFld: "address"},
67-
{ colHeader: "City", colItemFld: "city" },
68-
{ colHeader: "State", colItemFld: "state"}
65+
{ header: "Name", itemField: "name" },
66+
{ header: "Address", itemField: "address"},
67+
{ header: "City", itemField: "city" },
68+
{ header: "State", itemField: "state"}
6969
];
7070
7171
$scope.items = [

src/table/tableview/examples/table-view-with-toolbar.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
* @param {array} items Array of items to display in the table view.
1616
* @param {array} columns Array of table column information to display in the table's header row
1717
* <ul style='list-style-type: none'>
18-
* <li>.colHeader - (string) Text label for a column header
19-
* <li>.colItemFld - (string) Item field to associate with a particular column.
18+
* <li>.header - (string) Text label for a column header
19+
* <li>.itemField - (string) Item field to associate with a particular column.
2020
* </ul>
2121
* @param {array} actionButtons List of action buttons in each row
2222
* <ul style='list-style-type: none'>
@@ -76,10 +76,10 @@
7676
$scope.actionsText = "";
7777
7878
$scope.colummns = [
79-
{ colHeader: "Name", colItemFld: "name" },
80-
{ colHeader: "Age", colItemFld: "age"},
81-
{ colHeader: "Address", colItemFld: "address" },
82-
{ colHeader: "BirthMonth", colItemFld: "birthMonth"}
79+
{ header: "Name", itemField: "name" },
80+
{ header: "Age", itemField: "age"},
81+
{ header: "Address", itemField: "address" },
82+
{ header: "BirthMonth", itemField: "birthMonth"}
8383
];
8484
8585
$scope.dtOptions = {

src/table/tableview/table-view.component.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ angular.module('patternfly.table').component('pfTableView', {
8080
if (!validSelectionMatchProp()) {
8181
angular.forEach(ctrl.colummns, function (col) {
8282
if (props.length === 0) {
83-
props = col.colItemFld;
83+
props = col.itemField;
8484
} else {
85-
props += ", " + col.colItemFld;
85+
props += ", " + col.itemField;
8686
}
8787
});
8888
throw new Error("pfTableView - " +
@@ -332,7 +332,7 @@ angular.module('patternfly.table').component('pfTableView', {
332332

333333
ctrl.isColItemFld = function (key) {
334334
var retVal = false;
335-
var tableCol = $filter('filter')(ctrl.colummns, {colItemFld: key});
335+
var tableCol = $filter('filter')(ctrl.colummns, {itemField: key});
336336

337337
if (tableCol && tableCol.length === 1) {
338338
retVal = true;

src/table/tableview/table-view.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<thead>
44
<tr role="row">
55
<th class="table-view-pf-select"><input type="checkbox" value="$ctrl.selectAll" ng-model="$ctrl.selectAll" ng-change="$ctrl.toggleAll()"/></th>
6-
<th ng-repeat="col in $ctrl.colummns">{{col.colHeader}}</th>
6+
<th ng-repeat="col in $ctrl.colummns">{{col.header}}</th>
77
<th ng-if="$ctrl.areActions()" colspan="{{$ctrl.calcActionsColspan()}}">Actions</th>
88
</tr>
99
</thead>

src/toolbars/examples/toolbar.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@
144144
$scope.filtersText = '';
145145
146146
$scope.colummns = [
147-
{ colHeader: "Name", colItemFld: "name" },
148-
{ colHeader: "Age", colItemFld: "age"},
149-
{ colHeader: "Address", colItemFld: "address" },
150-
{ colHeader: "BirthMonth", colItemFld: "birthMonth"}
147+
{ header: "Name", itemField: "name" },
148+
{ header: "Age", itemField: "age"},
149+
{ header: "Address", itemField: "address" },
150+
{ header: "BirthMonth", itemField: "birthMonth"}
151151
];
152152
153153
// attempt to dyamically turn on/off pagination controls

0 commit comments

Comments
 (0)