You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 5, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,33 @@ The defaults for the grid item are:
65
65
}
66
66
```
67
67
68
+
#### Event Handling
69
+
-------------------
70
+
71
+
Both the `NgGrid` and `NgGridItem` throw events when an item is moved or resized. The grid has the following:
72
+
73
+
```javascript
74
+
dragStart(item) // When an item starts being dragged. Returns reference to corresponding NgGridItem
75
+
drag(item) // When an item moves while dragging. Returns reference to corresponding NgGridItem
76
+
dragStop(item) // When an item stops being dragged. Returns reference to corresponding NgGridItem
77
+
resizeStart(item) // When an item starts being resized. Returns reference to corresponding NgGridItem
78
+
resize(item) // When an item is resized. Returns reference to corresponding NgGridItem
79
+
resizeStop(item) // When an item stops being resized. Returns reference to corresponding NgGridItem
80
+
```
81
+
82
+
The individual items will also throw the following events:
83
+
84
+
```javascript
85
+
dragStart({'left': number, 'top': number}) // When the item starts being dragged. Returns object containing the item's raw left and top values
86
+
drag({'left': number, 'top': number}) // When the item moves while dragging. Returns object containing the item's raw left and top values
87
+
dragStop({'left': number, 'top': number}) // When the item stops being dragged. Returns object containing the item's raw left and top values
88
+
resizeStart({'width': number, 'height': number}) // When the item starts being resized. Returns object containing the item's raw width and height values
89
+
resize({'width': number, 'height': number}) // When the item is resized. Returns object containing the item's raw width and height values
90
+
resizeStop({'width': number, 'height': number}) // When the item stops being resized. Returns object containing the item's raw width and height values
91
+
itemChange({'col': number, 'row': number, // When the item's grid size or position is changed. Returns object containing the item's grid position and size
92
+
'sizex': number, 'sizey': number}) // The difference between this event and the above is that the values correspond to the psuedo-grid and not the dom positioning
0 commit comments