[CLOSED] Double load in combobox

  1. #1

    [CLOSED] Double load in combobox

    Hello, I have the following combobox:

    
    <ext:ComboBox ID="ComboCiudad" runat="server" FieldLabel="Origen" IDMode="Static"
            LabelWidth="50" Width="300" Hidden="true" StoreID="Store_Direccion" DisplayField="Ciudad"
            ValueField="Codigo">
                 <Listeners>
                       <Expand Handler="#{Store_Direccion}.reload();" />
                  </Listeners>
    </ext:ComboBox>
    
    <ext:Store ID="Store_Direccion" runat="server" RemoteSort="true" AutoLoad="false">
        <Proxy>
            <%-- Proxy --%>
            <ext:HttpProxy Json="false" Method="POST" Url="/Controles/DireccionService.asmx/getDirecciones">
            </ext:HttpProxy>
        </Proxy>
        <Reader>
            <ext:XmlReader Record="ws_ComboDirecciones" IDPath="Val1">
                <Fields>
                    <%--Record Fields--%>
                    <ext:RecordField Name="DireccionText" />
                    <ext:RecordField Name="DireccionValue" />
                    <%--Fin Record Fields--%>
                </Fields>
            </ext:XmlReader>
        </Reader>
        <Listeners>
            <LoadException Handler="Ext.MessageBox.alert('Error', response.statusText);" />
        </Listeners>
    </ext:Store>
    I want that the combobox is loaded from the web service each time you expand. This works fine, but the first time that you expand the combobox, the webservice is called twice times. How can we prevent this?

    Thanks
    Last edited by Daniil; Feb 02, 2012 at 9:31 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Please replace:
    <Expand Handler="#{Store_Direccion}.reload();" />
    with
    <BeforeQuery Handler="delete queryEvent.combo.lastQuery;" />
    See also
    http://docs.sencha.com/ext-js/3-4/#!...erty-lastQuery
  3. #3
    Thanks, work fine!

Similar Threads

  1. [CLOSED] Double Click on combobox field
    By GLD in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 11, 2012, 1:37 PM
  2. Replies: 2
    Last Post: Aug 04, 2011, 2:14 PM
  3. Load combobox when opening
    By Birgit in forum 1.x Help
    Replies: 12
    Last Post: Apr 07, 2011, 11:27 AM
  4. [CLOSED] [1.0] ComboBox invalid on load
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 14, 2010, 10:45 PM
  5. Load ComboBox
    By usantos in forum 1.x Help
    Replies: 0
    Last Post: Mar 13, 2010, 12:29 PM

Posting Permissions