I have a local JS array with multiple types of objects. I want to have a data table for each type of object (filtered by the type: “objecttype” value of each object). How would i filter each data table to only show objects for a specific object type.
Pseudo Example
// Array of objects.
myArray= [{type: car…}, {type: boat…}, {type: airplane…}]
// Datatables.
carDatatable.data/collection = objects of myArray of type car.
boatDatatable.data/collection = objects of myArray of type boat.
airplaneDatatable.data/collection = objects of myArray of type airplane.
I could create multiple arrays from the myArray, or a multi-dimensional array. But i don’t want that. I want all data tables to have the same source.