Description
ng-sortgrid is an Angular grid where users sort items by dragging them. Items can be moved in every direction, and several items can be selected and moved together by holding Ctrl while clicking. You loop over your items with ngFor, or pass them through an async pipe, and apply the ngSortGridItem directive to each one. Pass the array to the ngSortGridItems input and listen to the sorted output, which emits the previous and current order. That lets you store the new order in local storage or send it to a backend. Several grids on one page can be given a group name with ngSortGridGroup, so items cannot be dropped into the wrong grid. The library adds classes to items on each drag event, which you can style yourself or through the built-in stylesheet imported in angular.json. The README also covers scrolling, custom scroll points, a default scroll speed of 50, an API section, and mobile usage. It suits Angular apps that let people reorder cards, tiles or list items.…
Highlights
- Drag and drop sorting grid
- Multi-select with Ctrl and click
- Sorted output with old and new order
- Grouped grids
- Built-in CSS, scrolling and mobile usage
Ratings & Reviews
No ratings yet
Be the first to rate ng-sortgrid.
People also visit
ng-sortgrid FAQ
What is ng-sortgrid?
An Angular grid that lets people reorder items by dragging them, in any direction.
How do I save the new order?
Listen to the sorted output. It emits an NgsgOrderChange with previousOrder and currentOrder, which you can store or send to a server.
Does it work on mobile?
The README has a mobile usage section that covers touch use of the grid.
Can I have more than one grid on a page?
Yes. Give each grid a name through the ngSortGridGroup input so items cannot move between groups.
What are the best ng-sortgrid alternatives?
Popular alternatives to ng-sortgrid include gridstack, ng-dnd and sortablejs. See all ng-sortgrid alternatives























