Posted 9 April 2021, 5:51 am EST
Hi Wijmo Team,
I have JSON data with header, binding, groupindex, groupdirection, sortindex and sortdirection.
groupindex and sortindex values starts from 0,1,2… if none it is -1.
groupdirection, sortdirection values are ‘ASC’, ‘DESC’ and ‘’(none).
Here is the json column data
{binding: ‘name’,header: ‘Name’,visible: true, sortinex:‘-1’, sortdirection:‘’, groupindex:‘1’, groupdirection:‘ASC’},
{binding: ‘userId’,header: ‘User ID’, visible: true, sortinex:‘-1’, sortdirection:‘’, groupindex:‘-1’, groupdirection:‘’},
{binding: ‘jobTitleName’, header: ‘Job’, visible: true, sortinex:‘-1’, sortdirection:‘’, groupindex:‘0’, groupdirection:‘DESC’},
{binding: ‘team’, header: ‘Team’, visible: true, sortinex:‘1’, sortdirection:‘DESC’, groupindex:‘-1’, groupdirection:‘’}
{binding: ‘age’, header: ‘Age’, visible: true, sortinex:‘0’, sortdirection:‘ASC’, groupindex:‘’, groupdirection:‘’}
Used Angular and typescript for the application.
As per the requirement
- when grouping is done/dragged to a grouppanel, sorting ascending also should be added to the column and that sort will be termed as groupdirection and hierarchy of grouping termed as groupindex.
- Columns with only sorting are termed as sortindex and sortdirection.
Whenever grouping or sorting is performed or removed json data should be updated and saved and grid should refresh with updated json data.