I want to group grid headers using JavaScript as shown in the image below.
I used GetViewLayout and SetViewLayout to view and apply the existing grouping JSON, but the grouping does not work the same. (e.g. "groupColumns":[{"header":"Id"},{"header":"Price"},{"header":"Test","isCollapsed":false,"collapseTo":"","align":"center","children":[[{"header":"Name"},{"header":"Stock"}]]}]) .
It seems that SetViewLayout can only change the order of existing headers. It does not allow deletion.
Is it not possible to do grouping using SetViewLayout? Or is there another way to group headers through JavaScript?
I would appreciate it if you could tell me a good way.
Hi @Doyoung Choi ,
SetViewLayout only applies layout to existing columns, I think, and it can’t add new column groups. Use the JS below to group specific columns instead:
_________
Make sure to replace the bindings with your actual bindings.
Great ! this should work for sure
@Mihai Melencu,Oh, thank you very much. I’ll try it this way.