[CLOSED] Combobox expands after the store reload

  1. #1

    [CLOSED] Combobox expands after the store reload

    We have:
    - a GridPanel with the PageProxy defined,
    - a BufferView with headers (operator, filter)

    Talking about combobox filter.

    User picks a filter value (let's say Status='X'), combo collapses and custom 'applyFilter' function triggers which RELOADS the main GridPanel's store (GridPanel1.store.reload()), which subsequently loads the filter combobox's store again.

    The probllem is that load triggers combobox to expand, so in the end we have a combo expanded and a main data filtered.

    Although I can't explain what forced it to expand, I made some digging and found this stuff:


    The problem I have sounds like this one:


    http://www.sencha.com/forum/showthre...r-store-reload


    , although I don't see 'hasFocus' among the properties just like you did not in:

    http://www.sencha.com/forum/showthre...r-store-reload

    Not quite sure how, but it looks like this worked for them!? :
        
    var hasFocus = combo.hasFocus;
    combo.hasFocus = null;
    combo.store.load({
      callback: function(){
        if(combo.hasFocus === null){
          combo.hasFocus = hasFocus;
        }
      }
    });
    Anyway is there an Ext.Net way to set up store load CALLBACK function - not a HANDLER or maybe a HANDLER with an delay should be that?


    Appreciate any help,


    Thx.
    Last edited by Daniil; Jan 27, 2012 at 5:10 PM. Reason: [CLOSED]
  2. #2
    Hi,

    The links are broken.

    Regarding to the hasFocus property.

    This property appears in the ExtJS Ext.form.Field JavaScript class and it's private. Though it's private, sometimes, it's really helpful to use that property to determine a field has focus or not (only in JavaScript). I should say also that just setting it up to true/false has no effect, i.e. a field doesn't get or loose focus.

    Anyway is there an Ext.Net way to set up store load CALLBACK function - not a HANDLER or maybe a HANDLER with an delay should be that?
    You can set up a Delay declaratively (or, certainly, in code behind) like this:

    Delay
    <ext:Store runat="server">
        ...
        <Listeners>
            <Load Handler="alert('load');" Delay="100" />
        </Listeners>
    </ext:Store>
    A Callback you can set up the same way in JavaScript.

    Load Callback
    combo.getStore().load({
    
      callback : function () {
    
        alert('I'm callback');
    
      }
    });
    It's also possible for the reload.

    Reload Callback
     combo.getStore().reload({
    
       callback : function () {
    
         alert('I'm callback');
    
       }
     });
  3. #3
  4. #4
    Thanks.

    I'm not sure that solution helps or not, since I don't know the reason of the behavior you described.
  5. #5
    Hi @deejayns,

    Please clarify can we mark the thread as closed?

Similar Threads

  1. Replies: 2
    Last Post: May 12, 2011, 9:26 AM
  2. [CLOSED] How to reload store without PagingToolbar
    By krzak in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Feb 22, 2011, 9:54 AM
  3. [CLOSED] Store Load-handler cant reload child store
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 04, 2011, 7:56 AM
  4. [CLOSED] Store.remove(record) and Store.reload()
    By capecod in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 08, 2010, 10:03 AM
  5. [CLOSED] Keep selection after store reload
    By CSG in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 11, 2009, 6:59 AM

Tags for this Thread

Posting Permissions