Greetings,
I’m attempting to use the Datatable to create something similar to rows rendering example.
I’m successfully loading my data from my API as JSON, but this is where I run into an issue. All of my sorting, filtering, etc is done server side, and returns the JSON object in the order I desire it to output. This works perfectly, as long as I don’t group the items in the Datatable.
An example:
I have multiple product categories, eg. Cat1, Cat2, Cat3. Each of these categories has 1 or more sub categories, eg. Cat1Sub1, Cat1Sub2, etc. When I initialize the table, I use groups: [“BrandTitle”, “BrandName”] to combine the appropriate groups/subgroups. The JSON object would like this:
{
Available: “Available”
BrandName: “Cat1SubCat1”
BrandTitle: “Cat1”
Description: “Some thing”
DescriptionFull: “Some new thing from us!”
ItemNumber: “1234”
MarketingComments: null
Size: “each”
}
{
Available: “Available”
BrandName: “Cat1SubCat2”
BrandTitle: “Cat1”
Description: “Some thing”
DescriptionFull: “Some new thing from us!”
ItemNumber: “4321”
MarketingComments: null
Size: “each”
}
{
Available: “Available”
BrandName: “ACatSubCat1”
BrandTitle: “ACat”
Description: “Some thing”
DescriptionFull: “Some new thing from us!”
ItemNumber: “5678”
MarketingComments: null
Size: “each”
}
If groups are not set, Cat1 and its subcategories will appear first, like I want them to. If groups are set as I mentioned, ACat will appear first. How can I disable this automatic sorting when grouping?
Regards,
Dan