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
2727 - [ Basic usage] ( #basic-usage )
2828 - [ Requirements] ( #requirements )
2929 - [ API Documentation] ( #api-documentation )
30+ - [ Extend Library] ( #extend-library )
3031 - [ Touch devices support] ( #touch-devices-support )
3132 - [ gridstack.js for specific frameworks] ( #gridstackjs-for-specific-frameworks )
3233 - [ Change grid columns] ( #change-grid-columns )
@@ -127,6 +128,24 @@ Using gridstack.js with jQuery UI
127128Documentation can be found [ here] ( https://github.com/gridstack/gridstack.js/tree/develop/doc ) .
128129
129130
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+
130149## Touch devices support
131150
132151Please 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 1111 < link rel ="stylesheet " href ="../dist/gridstack-extra.css "/>
1212
1313 < 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-
2114 < script src ="../dist/jquery-ui.min.js "> </ script >
2215 < script src ="../src/gridstack.js "> </ script >
2316 < script src ="../src/gridstack.jQueryUI.js "> </ script >
You can’t perform that action at this time.
0 commit comments