File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ Join us on Slack: https://gridstackjs.troolee.com
27
27
- [ Basic usage] ( #basic-usage )
28
28
- [ Requirements] ( #requirements )
29
29
- [ API Documentation] ( #api-documentation )
30
+ - [ Extend Library] ( #extend-library )
30
31
- [ Touch devices support] ( #touch-devices-support )
31
32
- [ gridstack.js for specific frameworks] ( #gridstackjs-for-specific-frameworks )
32
33
- [ Change grid columns] ( #change-grid-columns )
@@ -127,6 +128,24 @@ Using gridstack.js with jQuery UI
127
128
Documentation can be found [ here] ( https://github.com/gridstack/gridstack.js/tree/develop/doc ) .
128
129
129
130
131
+ ## Extend Library
132
+
133
+ You can easily extend or patch gridstack with code like this:
134
+
135
+ ``` javascript
136
+ $ (function () {
137
+ // extend gridstack with our own custom method
138
+ window .GridStackUI .prototype .printCount = function () {
139
+ console .log (' grid has ' + this .grid .nodes .length + ' items' );
140
+ };
141
+
142
+ $ (' .grid-stack' ).gridstack ();
143
+
144
+ // you can now call on any grid this...
145
+ $ (' .grid-stack' ).data (' gridstack' ).printCount ();
146
+ });
147
+ ```
148
+
130
149
## Touch devices support
131
150
132
151
Please use [ jQuery UI Touch Punch] ( https://github.com/furf/jquery-ui-touch-punch ) to make jQuery UI Draggable/Resizable
Original file line number Diff line number Diff line change 11
11
< link rel ="stylesheet " href ="../dist/gridstack-extra.css "/>
12
12
13
13
< script src ="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js "> </ script >
14
- <!--
15
-
16
- <script src="https://cdn.jsdelivr.net/npm/gridstack@0.6.3/dist/gridstack.js"></script>
17
- <script src="https://cdn.jsdelivr.net/npm/gridstack@0.6.3/dist/jquery-ui.js"></script>
18
- <script src="https://cdn.jsdelivr.net/npm/gridstack@0.6.3/dist/gridstack.jQueryUI.js"></script>
19
- -->
20
-
21
14
< script src ="../dist/jquery-ui.min.js "> </ script >
22
15
< script src ="../src/gridstack.js "> </ script >
23
16
< script src ="../src/gridstack.jQueryUI.js "> </ script >
You can’t perform that action at this time.
0 commit comments