Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

Commit

Permalink
fix and enable remote demo, refs #46
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Feb 6, 2015
1 parent 9905304 commit 29edc90
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
24 changes: 16 additions & 8 deletions docs/content/demos/remote.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ title: Remote Data
section: Demos
---

Click one of the buttons and see the request / response in your debug
console. Please note that sorting won't work here because the backend
always returns static dummy data (but you can see the parameters being
set in your debug console).

```javascript
$(document).ready(function () {
$("#grid").jqGrid({
Expand All @@ -15,20 +20,23 @@ $(document).ready(function () {
{ label: 'Tax', name: 'tax', width: 80 },
{ label: 'Total', name: 'total', width: 80 },
{ label: 'Notes', name: 'note', width: 150 }
],
pager: '#pager'
]
});

$('<button type="button" class="btn btn-default">Get JSON</button>')
.on('click', function(){
$('#grid').jqGrid('setGridParam',{url: './data/basic.json'}).trigger('reloadGrid');
})
.insertAfter($('#show-code'));
$('#grid').jqGrid('setGridParam', {
datatype: 'json',
url: './data/basic.json'}).trigger('reloadGrid');
})
.insertAfter($('#show-code'));

$('<button type="button" class="btn btn-default">Get XML</button>')
.on('click', function(){
$('#grid').jqGrid('setGridParam',{url: './data/basic.xml'}).trigger('reloadGrid');
})
.insertAfter($('#show-code'));
$('#grid').jqGrid('setGridParam', {
datatype: 'xml',
url: './data/basic.xml'}).trigger('reloadGrid');
})
.insertAfter($('#show-code'));
});
```
1 change: 1 addition & 0 deletions docs/template/data/demos.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[
{"filename": "local.html", "title": "Local Data"},
{"filename": "remote.html", "title": "Remote Data"},
{"filename": "pager.html", "title": "Pagination"},
{"filename": "kitchensink.html", "title": "Kitchen Sink"},
{"filename": "grouping.html", "title": "Grouping"},
Expand Down

0 comments on commit 29edc90

Please sign in to comment.