Default Sort Example

To add default sorting to a column you need two things enabled:

  1. sort  attribute on the <zing-grid>  tag

  2. sort-asc  or sort-desc  attribute on a SINGLE <zg-column> 

1 will enable sorting across the grid, and 2 will add a default sort to a zg-column.

To remove sorting capabilities from a single column, add sort="disabled" to the <zg-column> to disable sort on.

See the demo below for a full implementation!

A demo showing a column sorted on render.

  1. API element zing-grid  - https://www.zinggrid.com/docs/api-elements#zing-grid-sort

  2. API element zg-column- https://www.zinggrid.com/docs/api-elements#zg-column-sortAsc

  3. Demo - https://app.zingsoft.com/demos/create/7YFFO3N2

Did this answer your question?