I am working on creating a list and have designed the following Schema:
new SimpleSchema({
element: { type: String, optional: true },
note: { type: String, optional: true },
order: { type: Number, optional: true }
});
Now, I want to include groups within the list:
Pancakes
Vegetables
Tomatoes
Salad
Orange juice
Here, 'Vegetables' is a group with two sub-elements. The main list consists of three elements: Pancakes, Vegetables, and Orange juice. The 'Vegetables' group can be sorted independently to display its contents.
What would be the most straightforward schema to achieve this without excessive nesting of SimpleSchema elements?
The goal is to allow editors to select elements from the list and group them together. Both main elements and groups should be sortable via Drag'n drop. Therefore, the order of elements and groups needs to be preserved.
I hope this clarifies my requirements.