I need help with displaying a list that contains three columns: menu
, menuItem
, and order
.
The desired display format is to show menu
and menuItem
ordered by order
as follows:
Menu 1 : order 200
Menu 2 : order 230
Menu 3 : order 250
Menu item 1 : order 210
Menu item 2 : order 360
This would result in:
- Menu 1 has menu item 1 (200 < 210 < 230)
- Menu 2 : does not have a menu item
- Menu 3 has menu item 2 (because 250 < 360).
I attempted this by using two lists, one for the menu and another for the menu items. I then tried to save the items falling between the indexes of two menus in a new list for display. However, I am facing an issue with accurately displaying the values for every menu.
Could anyone provide assistance on this matter?
For(I=0; I< list1.length ;I++){
let nextMenu = list1.order[I+1];
for (j=0;j<list2.length ;j++){
let item = list2[j].order;
let menu = list1[I].order;
if(menu < item < Next menu){
This.list3.push(list2[j]);
}
}
}