RowGroup using asp.net core mvc
RowGroup using asp.net core mvc
No matter what I set the dataSrc value to I can only get the grouping to happen on the first column (in this case FirstName). I am sending a list from the controller to the view. Standard html/razor markup.
My js code
, "rowGroup": [{ dataSrc: "gender" }]
or
, "rowGroup": [{ dataSrc: 'gender' }]
or
, "rowGroup": [{ dataSrc: 2 }]
return the same result, Grouping based on the first column (gender is the 3rd). I have tried upper case, lower case, single quotes and double quotes all to no avail.
Additionally the first names are repeated so I get
Mary
Mary Wilson ....
Mary Smith ....
What am I missing? Thanks
p.s. css formatting seems fine and I have no js errors in the debugger.
This question has an accepted answers - jump to answer
Answers
All of the examples I looked at don't use an array for the rowGroup options.
Maybe you need to do this instead:
"rowGroup": { dataSrc: 2 }
Whether you use column number or name depends on the type (array or object) table you have. Refer to the
rowGroup.dataSrc
docs for more info.Kevin
Thanks that worked. I swear I tried it with no array [] but today it works.