Skip to content

Commit c84438d

Browse files
committed
Inlined remote-source in data.html.
1 parent f3a05be commit c84438d

File tree

2 files changed

+31
-52
lines changed

2 files changed

+31
-52
lines changed

grid-datamodel/data.html

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,27 @@
5656
source: data
5757
});
5858

59+
$.ui.dataitem.extend( "developer2", {} );
60+
$.ui.datasource({
61+
type: "developer2",
62+
source: function( request, response ) {
63+
$.getJSON( "fixture.json", request, response );
64+
}
65+
});
66+
5967
$(function() {
6068
$( "#developers" ).grid({
6169
type: "developer",
6270
rowTemplate: $( "#row-tmpl" ).html(),
6371
select: showDetails
6472
});
73+
74+
$( "#developers-remote" ).grid({
75+
type: "developer2",
76+
// TODO when these are specified, the table header row should be removeable/generated?
77+
columns: [ "firstName", "lastName", "country" ],
78+
select: showDetails
79+
});
6580

6681
$( "#developers-pe" ).grid({
6782
select: showDetails
@@ -131,7 +146,7 @@ <h2>data extraction</h2>
131146
</tbody>
132147
</table>
133148

134-
<h2>data source</h2>
149+
<h2>local data source</h2>
135150
<table id="developers">
136151
<thead>
137152
<tr>
@@ -144,6 +159,21 @@ <h2>data source</h2>
144159
</tbody>
145160
</table>
146161

162+
163+
<h2>remote data source</h2>
164+
<table id="developers-remote">
165+
<thead>
166+
<tr>
167+
<th data-field="firstName">First Name</th>
168+
<th data-field="lastName">Last Name</th>
169+
<th data-field="country">Country</th>
170+
</tr>
171+
</thead>
172+
<tbody>
173+
</tbody>
174+
</table>
175+
176+
147177
<div id="developer"></div>
148178
<div id="developer-form"></div>
149179

grid-datamodel/remote-source.html

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)