Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 446f59a

Browse files
committed
events/API description
1 parent 984e2de commit 446f59a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,39 @@ Usage
7272
- `data-gs-no-resize` - disable element resizing
7373
- `data-gs-auto-position` - tells to ignore `data-gs-x` and `data-gs-y` attributes and to place element to the first
7474
available position
75+
76+
## Events
77+
78+
### onchange
79+
80+
Occurs when widgets change their position/size
81+
82+
```javascript
83+
$('.grid-stack').on('change', function (e, items) {
84+
serialize_widget_map(items);
85+
});
86+
```
87+
88+
## API
89+
90+
### add_widget(el, x, y, width, height, auto_position)
91+
92+
Creates new widget.
93+
94+
Parameters:
95+
96+
- `el` - widget to add
97+
- `x`, `y`, `width`, `height` - widget position/dimensions (Optional)
98+
- `auto_position` - if `true` then `x`, `y` parameters will be ignored and widget will be places on the first available
99+
position
100+
101+
### remove_widget(el)
102+
103+
Removes widget from the grid.
104+
105+
Parameters:
106+
107+
- `el` - widget to add
75108

76109
## Use with knockout.js
77110

0 commit comments

Comments
 (0)