Oct 13, 2008, 12:07 PM
[CLOSED] ComboBox in GridPanel
Hi all,
referring to examples -> DataSource Update -> SqlDataSource there is the field 'Region' as a combobox.
I'm working with a similar task, the only difference is I'm using an object data source.
What if the field points to the ID of a separate entity/table 'REGIONS', for example TB_REGIONS?
| ID_REGION | REGION_NAME
At editing mode, I could successfully load the combo with the list of values passed through out the Store object, but then the field shows the ID and not the description of my Object, according to the example the ID_REGION and not REGION_NAME.
When loading the grid the field looks empty. The grid doesn't show the 'Description'
Store for combo:
Thanx
Matteo
referring to examples -> DataSource Update -> SqlDataSource there is the field 'Region' as a combobox.
I'm working with a similar task, the only difference is I'm using an object data source.
What if the field points to the ID of a separate entity/table 'REGIONS', for example TB_REGIONS?
| ID_REGION | REGION_NAME
At editing mode, I could successfully load the combo with the list of values passed through out the Store object, but then the field shows the ID and not the description of my Object, according to the example the ID_REGION and not REGION_NAME.
When loading the grid the field looks empty. The grid doesn't show the 'Description'
Store for combo:
<ext:Store runat="server" ID="TipoTemplateStore" DataSourceID="XpoDataSourceTemplateType">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="Oid" />
<ext:RecordField Name="Description" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
The Grid Reader:
<ext:Store ID="StoreTemplateMail" DataSourceID="XpoDataSourceTemplateMail" runat="server">
<Reader>
<ext:JsonReader ReaderID="Oid">
<Fields>
<ext:RecordField Name="Oid" Type="Int" />
<ext:RecordField Name="TipoTemplate" Type="Auto" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
The grid:
<ext:GridPanel ID="GridPanelTemplateMail" AutoWidth="true" EnableViewState="true"
AutoHeight="true" runat="server" StoreID="StoreTemplateMail" Title="Archivio Template Mail"
Icon="Email">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ColumnID="clmOid" Hideable="false" Header="ID" Sortable="true" DataIndex="Oid" />
<Editor>
<ext:ComboBox ID="cbTipoTemplate"
EnableViewState="true"
runat="server"
ForceSelection="true"
StoreID="TipoTemplateStore"
DisplayField="Description"
ValueField="Oid">
</ext:ComboBox>
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
</ext:GridPanel>
About the Grid Reader I would write in the RecordField Name: TipoTemplate.DescriptionThanx
Matteo