source:
trunk/workshop-routing-foss4g/web/GeoExt/examples/attribute-form.js
@
78
Revision 76, 1.0 KB checked in by djay, 13 years ago (diff) | |
---|---|
|
Line | |
---|---|
1 | /** |
2 | * Copyright (c) 2008-2009 The Open Source Geospatial Foundation |
3 | * |
4 | * Published under the BSD license. |
5 | * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text |
6 | * of the license. |
7 | */ |
8 | |
9 | /** api: example[attribute-form] |
10 | * Attribute Form |
11 | * -------------- |
12 | * Create a form with fields from attributes read from a WFS |
13 | * DescribeFeatureType response |
14 | */ |
15 | |
16 | var form; |
17 | |
18 | Ext.onReady(function() { |
19 | Ext.QuickTips.init(); |
20 | |
21 | // create attributes store |
22 | var attributeStore = new GeoExt.data.AttributeStore({ |
23 | url: "data/describe_feature_type.xml" |
24 | }); |
25 | |
26 | form = new Ext.form.FormPanel({ |
27 | renderTo: document.body, |
28 | autoScroll: true, |
29 | height: 300, |
30 | width: 350, |
31 | defaults: { |
32 | width: 120, |
33 | maxLengthText: "too long", |
34 | minLengthText: "too short" |
35 | }, |
36 | plugins: [ |
37 | new GeoExt.plugins.AttributeForm({ |
38 | attributeStore: attributeStore |
39 | }) |
40 | ] |
41 | }); |
42 | |
43 | attributeStore.load(); |
44 | }); |
Note: See TracBrowser
for help on using the repository browser.