Jun 28, 2011, 1:39 PM
Combobox with two stores
Hello, I'm using a combobox to display an object via JSONreader"
and I'm using another store to provide the SELECTED value:
What I need to do is that the second store provides the combobox with the correct item to be selected from the first store, any ideas?
<ext:ComboBox ID="Requester" runat="server" FieldLabel="Requester" Editable="true"
TypeAhead="true" ForceSelection="true" AnchorHorizontal="95%" ValueField="Id"
DisplayField="FullName" Mode="Local" BlankText="Requester is required" AllowBlank="false"
MsgTarget="Side" LoadingText="Loading..">
<Store>
<ext:Store ID="Store1" runat="server" AutoLoad="true">
<Proxy>
<ext:HttpProxy Url="~/Lookups/GetActiveRequesters" Json="true" Method="GET" Timeout="60000" />
</Proxy>
<Reader>
<ext:JsonReader IDProperty="Id" Root="data" TotalProperty="total">
<Fields>
<ext:RecordField Name="Id" SortDir="ASC" />
<ext:RecordField Name="FullName" Type="String" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
</ext:ComboBox>
and I'm using another store to provide the SELECTED value:
<ext:Store ID="dsdraft" runat="server" AutoLoad="true">
<Proxy>
<ext:HttpProxy Url="~/Applications/GetDraftDetails" Json="true" />
</Proxy>
<BaseParams>
<ext:Parameter Name="id" Value="#{selectedRow}.getValue()" Mode="Raw" />
</BaseParams>
<Reader>
<ext:JsonReader Root="data">
<Fields>
<ext:RecordField Name="Requester" />
<ext:RecordField Name="RequestedOperation" />
<ext:RecordField Name="Operator" />
<ext:RecordField Name="From" />
<ext:RecordField Name="To" />
<ext:RecordField Name="Frequency" />
<ext:RecordField Name="NoFlight" />
</Fields>
</ext:JsonReader>
</Reader>
<Listeners>
<Load Handler="#{frmMain}.getForm().loadRecord(records[0]);" />
</Listeners>
</ext:Store>
I tried sending the GUID value of the Requester ID and tried sending the whole Requester object (which contains ID), in the former case the combobox is filled with the GUID string provided and the correct combobox entry is NOT selected, in the latter case [object Object] is displayed.What I need to do is that the second store provides the combobox with the correct item to be selected from the first store, any ideas?