1 | |
---|
2 | .. currentmodule:: GeoExt.grid |
---|
3 | |
---|
4 | :class:`GeoExt.grid.FeatureSelectionModel` |
---|
5 | ================================================================================ |
---|
6 | |
---|
7 | |
---|
8 | .. cssclass:: meta |
---|
9 | |
---|
10 | |
---|
11 | Extends |
---|
12 | * `Ext.grid.RowSelectionModel <http://dev.sencha.com/deploy/dev/docs/?class=Ext.grid.RowSelectionModel>`_ |
---|
13 | |
---|
14 | |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | |
---|
20 | .. class:: FeatureSelectionModel |
---|
21 | |
---|
22 | A row selection model which enables automatic selection of features |
---|
23 | in the map when rows are selected in the grid and vice-versa. |
---|
24 | |
---|
25 | |
---|
26 | |
---|
27 | Example Use |
---|
28 | ----------- |
---|
29 | |
---|
30 | Sample code to create a feature grid with a feature selection model: |
---|
31 | |
---|
32 | .. code-block:: javascript |
---|
33 | |
---|
34 | var gridPanel = new Ext.grid.GridPanel({ |
---|
35 | title: "Feature Grid", |
---|
36 | region: "east", |
---|
37 | store: store, |
---|
38 | width: 320, |
---|
39 | columns: [{ |
---|
40 | header: "Name", |
---|
41 | width: 200, |
---|
42 | dataIndex: "name" |
---|
43 | }, { |
---|
44 | header: "Elevation", |
---|
45 | width: 100, |
---|
46 | dataIndex: "elevation" |
---|
47 | }], |
---|
48 | sm: new GeoExt.grid.FeatureSelectionModel() |
---|
49 | }); |
---|
50 | |
---|
51 | |
---|
52 | |
---|
53 | |
---|
54 | Config Options |
---|
55 | -------------- |
---|
56 | |
---|
57 | Configuration properties in addition to |
---|
58 | those listed for `Ext.grid.RowSelectionModel <http://dev.sencha.com/deploy/dev/docs/?class=Ext.grid.RowSelectionModel>`_. |
---|
59 | |
---|
60 | |
---|
61 | .. describe:: autoActivateControl |
---|
62 | |
---|
63 | ``Boolean`` If true the select feature control is activated and |
---|
64 | deactivated when binding and unbinding. Defaults to true. |
---|
65 | |
---|
66 | .. describe:: layer |
---|
67 | |
---|
68 | ``OpenLayers.Layer.Vector`` The vector layer used for the creation of |
---|
69 | the select feature control, it must already be added to the map. If not |
---|
70 | provided, the layer bound to the grid's store, if any, will be used. |
---|
71 | |
---|
72 | .. describe:: layerFromStore |
---|
73 | |
---|
74 | ``Boolean`` If true, and if the constructor is passed neither a |
---|
75 | layer nor a select feature control, a select feature control is |
---|
76 | created using the layer found in the grid's store. Set it to |
---|
77 | false if you want to manually bind the selection model to a |
---|
78 | layer. Defaults to true. |
---|
79 | |
---|
80 | .. describe:: selectControl |
---|
81 | |
---|
82 | ``OpenLayers.Control.SelectFeature`` A select feature control. If not |
---|
83 | provided one will be created. If provided any "layer" config option |
---|
84 | will be ignored, and its "multiple" option will be used to configure |
---|
85 | the selectionModel. If an ``Object`` is provided here, it will be |
---|
86 | passed as config to the SelectFeature constructor, and the "layer" |
---|
87 | config option will be used for the layer. |
---|
88 | |
---|
89 | |
---|
90 | |
---|
91 | |
---|
92 | |
---|
93 | |
---|
94 | Public Methods |
---|
95 | -------------- |
---|
96 | |
---|
97 | Public methods in addition to those |
---|
98 | listed for `Ext.grid.RowSelectionModel <http://dev.sencha.com/deploy/dev/docs/?class=Ext.grid.RowSelectionModel>`_. |
---|
99 | |
---|
100 | |
---|
101 | .. method:: FeatureSelectionModel.bind |
---|
102 | |
---|
103 | :param obj: ``OpenLayers.Layer.Vector`` or |
---|
104 | ``OpenLayers.Control.SelectFeature`` The object this selection model |
---|
105 | should be bound to, either a vector layer or a select feature |
---|
106 | control. |
---|
107 | :param options: ``Object`` An object with a "controlConfig" |
---|
108 | property referencing the configuration object to pass to the |
---|
109 | ``OpenLayers.Control.SelectFeature`` constructor. |
---|
110 | :return: ``OpenLayers.Control.SelectFeature`` The select feature |
---|
111 | control this selection model uses. |
---|
112 | |
---|
113 | Bind the selection model to a layer or a SelectFeature control. |
---|
114 | |
---|
115 | .. method:: FeatureSelectionModel.unbind |
---|
116 | |
---|
117 | :return: ``OpenLayers.Control.SelectFeature`` The select feature |
---|
118 | control this selection model used. |
---|
119 | |
---|
120 | Unbind the selection model from the layer or SelectFeature control. |
---|
121 | |
---|
122 | |
---|
123 | |
---|
124 | |
---|
125 | |
---|