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  -

  2. API element zg-column-

  3. Demo -

Did this answer your question?