katoid / angular-grid-layout

Responsive grid with draggable and resizable items for Angular applications.
https://katoid.github.io/angular-grid-layout
MIT License
436 stars 60 forks source link

Turn off drag and resize feature #89

Closed monis01 closed 1 year ago

monis01 commented 1 year ago

Question: Is there any way in current release to turn of drag and resize feature ?

Requirement: When dashboard is in edit mode than only items can be dragged and resized and when layout is finalized user can save that layout and not able to drag and resize again.

P.S. : In TODO features it's mentioned Grid support for static grid items. is this same for disabling drag and resize ?

llorenspujol commented 1 year ago

Yes, you have two flags to enable/disable dragging and resizing for each grid item:

<ktd-grid [cols]="cols"
          [rowHeight]="rowHeight"
          [layout]="layout"
          (layoutUpdated)="onLayoutUpdated($event)">
    <ktd-grid-item *ngFor="let item of layout; trackBy:trackById"
                         [id]="item.id"
                         [draggable]="!disableDrag"
                         [resizable]="!disableResize">

    </ktd-grid-item>
</ktd-grid>

You can see it also on the playground example