Skip to content

Commit bfdd4a8

Browse files
author
Aasim Goriya
committed
Fixed: () undefined issue
1 parent 13e54e1 commit bfdd4a8

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

app/code/Magento/Ui/view/base/web/js/grid/columns/column.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ define([
299299
* @returns {String}
300300
*/
301301
getLabel: function (record) {
302-
return record[this.index];
302+
return record !== undefined ? record[this.index] : null;
303303
},
304304

305305
/**

app/code/Magento/Ui/view/base/web/js/grid/editing/editor-view.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,18 @@ define([
2828
'<!-- /ko -->',
2929
rowTmpl:
3030
'<!-- ko with: _editor -->' +
31-
'<!-- ko if: isActive($row()._rowIndex, true) -->' +
32-
'<!-- ko with: getRecord($row()._rowIndex, true) -->' +
33-
'<!-- ko template: rowTmpl --><!-- /ko -->' +
34-
'<!-- /ko -->' +
35-
'<!-- ko if: isSingleEditing && singleEditingButtons -->' +
36-
'<!-- ko template: rowButtonsTmpl --><!-- /ko -->' +
31+
'<!-- ko if: typeof $row() !== "undefined" -->' +
32+
'<!-- ko if: isActive($row()._rowIndex, true) -->' +
33+
'<!-- ko if: typeof $row() !== "undefined" -->' +
34+
'<!-- ko with: getRecord($row()._rowIndex, true) -->' +
35+
'<!-- ko template: rowTmpl --><!-- /ko -->' +
36+
'<!-- /ko -->' +
37+
'<!-- /ko -->' +
38+
'<!-- ko if: typeof $row() !== "undefined" -->' +
39+
'<!-- ko if: isSingleEditing && singleEditingButtons -->' +
40+
'<!-- ko template: rowButtonsTmpl --><!-- /ko -->' +
41+
'<!-- /ko -->' +
42+
'<!-- /ko -->' +
3743
'<!-- /ko -->' +
3844
'<!-- /ko -->' +
3945
'<!-- /ko -->'

app/code/Magento/Ui/view/base/web/templates/grid/cells/actions.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* See COPYING.txt for license details.
55
*/
66
-->
7+
<!-- ko if: $row() -->
78
<a
89
class="action-menu-item"
910
if="$col.isSingle($row()._rowIndex)"
@@ -20,3 +21,4 @@
2021
</li>
2122
</ul>
2223
</div>
24+
<!-- /ko -->

app/code/Magento/Ui/view/base/web/templates/grid/cells/multiselect.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* See COPYING.txt for license details.
55
*/
66
-->
7+
<!-- ko if: $row() -->
78
<label class="data-grid-checkbox-cell-inner">
89
<input class="admin__control-checkbox" type="checkbox" data-action="select-row"
910
data-bind="
@@ -15,3 +16,4 @@
1516
}"/>
1617
<label attr="for: index + 'check' + $row()[$col.indexField]"></label>
1718
</label>
19+
<!-- /ko -->

app/code/Magento/Ui/view/base/web/templates/grid/listing.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<tr each="data: getVisible(), as: '$col'" render="getHeader()"></tr>
1111
</thead>
1212
<tbody>
13-
<tr class="data-row" repeat="foreach: rows, item: '$row'" css="'_odd-row': $index % 2">
14-
<td outerfasteach="data: getVisible(), as: '$col'"
13+
<tr if="rows" class="data-row" repeat="foreach: rows, item: '$row'" css="'_odd-row': $index % 2">
14+
<td if="$row()" outerfasteach="data: getVisible(), as: '$col'"
1515
css="getFieldClass($row())" click="getFieldHandler($row())" template="getBody()"></td>
1616
</tr>
1717
<tr ifnot="hasData()" class="data-grid-tr-no-data">

0 commit comments

Comments
 (0)