WijGrid allows to interactively sort any column or expand/collapse any group. However, some customers have a requirement wherein they need to apply sorting on a specific column or toggle any particular group through code, based on some user action or manipulation. This blog demonstrates how this can be achieved by creating custom methods for sorting programmatically and expanding/collapsing only one group through jQuery. To start with, we would refer the online demo to create a Wijgrid with grouping. Now, we would access the specific column on which we want to apply sorting and set its sortDirection property. Here is the custom method which you can use directly :
The second part describes how you can toggle any specific group through code. For doing so, you need the indexes of GroupedColumn and the specific group you want to expand. Once we get this information, we would check its expanded state and change it accordingly. The following method will do the job for you:
You may also refer to this sample for complete implementation.