Combobox with two stores

  1. #1

    Combobox with two stores

    Hello, I'm using a combobox to display an object via JSONreader"

    <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?
  2. #2
    @all, I need to know how to do this please, I can provide any missing info.
  3. #3
    Hi,

    I did not understand why do you need two stores for one combo, why don't you return all required data for one store in one request?
  4. #4
    Hi vladimir, the thing is I want one store to provide the combobox items, and the other to to provide which item is SELECTED, using the form.loadrecord()

Similar Threads

  1. Passing data between different 2 Stores
    By titombo in forum 1.x Help
    Replies: 0
    Last Post: Jul 15, 2011, 8:54 AM
  2. Ext.net.Debug + Stores
    By peter.campbell in forum 1.x Help
    Replies: 2
    Last Post: Mar 29, 2011, 10:54 AM
  3. Grid and Stores
    By walle in forum 1.x Help
    Replies: 4
    Last Post: Dec 01, 2010, 10:57 AM
  4. [CLOSED] ComboBox Stores
    By state in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 20, 2009, 2:43 PM
  5. [CLOSED] Committing several stores
    By pschojer in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 17, 2009, 8:32 AM

Posting Permissions