File tree 1 file changed +6
-4
lines changed
src/app/shared/components/template/components/data-items
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -93,13 +93,15 @@ export class TmplDataItemsComponent extends TemplateBaseComponent implements OnD
93
93
[ index : string ] : any ;
94
94
}
95
95
) {
96
- const lastRowIndex = rows . length - 1 ;
97
- return rows . map ( ( r , i ) => {
96
+ const rowIds = Object . values ( dataList ) . map ( ( v ) => v . id ) ;
97
+ const lastRowIndex = rowIds . length - 1 ;
98
+ return rows . map ( ( r ) => {
98
99
// Reassign metadata fields previously assigned by item as rendered row count may have changed
100
+ const itemIndex = rowIds . indexOf ( r ) ;
99
101
r . _evalContext . itemContext = {
100
102
...r . _evalContext . itemContext ,
101
- _first : i === 0 ,
102
- _last : i === lastRowIndex ,
103
+ _first : itemIndex === 0 ,
104
+ _last : itemIndex === lastRowIndex ,
103
105
} ;
104
106
// Update any action list set_item args to contain name of current data list and item id
105
107
// and set_items action to include all currently displayed rows
You can’t perform that action at this time.
0 commit comments