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

Skip to content

Commit 0cf6542

Browse files
committed
update demo site
1 parent b1ee8a4 commit 0cf6542

File tree

1 file changed

+1
-56
lines changed

1 file changed

+1
-56
lines changed

index.html

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
<hr class="star-light">
8989
<p>gridstack.js is a jQuery plugin for widget layout. This is drag-and-drop multi-column
9090
grid. It allows you to build draggable responsive bootstrap v3 friendly layouts.
91-
It also works great with <a href="http://knockoutjs.com">knockout.js</a></p>
91+
It also works great with <a href="http://knockoutjs.com">knockout.js</a> and touch devices.</p>
9292

9393
<p>Inspired by <a href="http://gridster.net">gridster.js</a>. Built with love.</p>
9494
</div>
@@ -161,61 +161,6 @@ <h3>Basic Usage</h3>
161161

162162
<p>For more samples and documentation please visit <a href="https://github.com/troolee/gridstack.js">https://github.com/troolee/gridstack.js</a>.</p>
163163

164-
<h3>Use with knockout.js</h3>
165-
166-
<pre><code class="javascript">
167-
ko.components.register('dashboard-grid', {
168-
viewModel: {
169-
createViewModel: function (params, componentInfo) {
170-
var ViewModel = function (params, componentInfo) {
171-
var grid = null;
172-
173-
this.widgets = params.widgets;
174-
175-
this.afterAddWidget = function (items) {
176-
_.each(items, function (item) {
177-
item = $(item);
178-
179-
if (grid == null) {
180-
grid = $(componentInfo.element).find('.grid-stack').gridstack({
181-
auto: false
182-
}).data('gridstack');
183-
}
184-
185-
grid.add_widget(item);
186-
ko.utils.domNodeDisposal.addDisposeCallback(item[0], function () {
187-
grid.remove_widget(item);
188-
});
189-
}, this);
190-
};
191-
192-
};
193-
194-
return new ViewModel(params, componentInfo);
195-
}
196-
},
197-
template: [
198-
'&lt;div class=&quot;grid-stack&quot;&gt;',
199-
' &lt;!-- ko foreach: widgets, afterRender: afterAddWidget --&gt;',
200-
' &lt;div class=&quot;grid-stack-item&quot; data-bind=&quot;attr: {',
201-
' \'data-gs-x\': x,',
202-
' \'data-gs-y\': y,',
203-
' \'data-gs-width\': width,',
204-
' \'data-gs-height\': height',
205-
' }&quot;&gt;',
206-
' &lt;span data-bind=&quot;text: $index&quot;&gt;&lt;/span&gt;',
207-
' &lt;/div&gt;',
208-
' &lt;!-- /ko --&gt;',
209-
'&lt;/div&gt;'
210-
].join('\n')
211-
});
212-
</code></pre>
213-
214-
<p>and HTML:</p>
215-
216-
<pre><code class="html">
217-
&lt;div data-bind=&quot;component: {name: 'dashboard-grid', params: $data}&quot;&gt;&lt;/div&gt;
218-
</code></pre>
219164
</div>
220165
</section>
221166

0 commit comments

Comments
 (0)