[CLOSED] Is Store Loading Problem

  1. #1

    [CLOSED] Is Store Loading Problem

    Dear Support Members,
    How can I check is combo box store Loaded through java script. I have found a method in ext js 4.0 Documentation isLoading() but on using this function undefined error originates am I missing some thing I am using following code.

    var categoryComboBox = Ext.getCmp(this.Request_Detail_Category);
                var categoryStore = categoryComboBox.getStore();            
                while (categoryStore.isLoading()) {
                    alert('Loading...');
                }
    Last edited by Daniil; Dec 09, 2011 at 9:30 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Ext.Net 1.x is based on ExtJS 3.x.
    http://docs.sencha.com/ext-js/3-4

    In Ext.Net 1.x I can suggest to use the BeforeLoad and Load listeners:
    http://docs.sencha.com/ext-js/3-4/#!...ent-beforeload
    http://docs.sencha.com/ext-js/3-4/#!...ore-event-load

    Also I think it's not an option to use the native alert function, because it stops JavaScript execution.

    Do you just need to demonstrate a user when a store is loading, isn't that so?

    If yes, there is the built-in masking feature.

    Please try to click on a ComboBox's trigger.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Store_RefreshData(object sender, StoreRefreshDataEventArgs e)
        {
            System.Threading.Thread.Sleep(5000);
            Store store = (Store)sender;
            store.DataSource = new object[] 
            { 
                new object[] { "1", "item1" },
                new object[] { "2", "item2" },
                new object[] { "3", "item3" }
            };
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:ComboBox ID="ComboBox1" runat="server">
                <Store>
                    <ext:Store runat="server" OnRefreshData="Store_RefreshData">
                        <Proxy>
                            <ext:PageProxy />
                        </Proxy>
                        <Reader>
                            <ext:ArrayReader>
                                <Fields>
                                    <ext:RecordField Name="value" />
                                    <ext:RecordField Name="text" />
                                </Fields>
                            </ext:ArrayReader>
                        </Reader>
                    </ext:Store>
                </Store>
            </ext:ComboBox>
        </form>
    </body>
    </html>
  3. #3
    No, I want to show Detail of a Grid Row in a Window.
    I am Loading a Window dynamically and on success of the event I want to populates all fields with record values. e.g

    I have loaded a window dynamically, All html generated successfully and then success event handlers and all comboBox stores load event fires simualtanously obviously success event set value of combo Box before combo Box Store Loaded and in result a numeric value shown in comboBox.

    if i apply some wait function on success event handler like 'setTimeOut' then it show original text value.
    Now I want to wait untill the store loaded and then I want to setValue() of comboBox so that original value shown instead of ID.
  4. #4
    Then I would suggest:

    1. Set up AutoLoad="false" for a ComboBox's Store.

    2. Call the Store's load method with a callback.
    store.load({
        callback : function () {
            ComboBox1.setValue(value);
        }
    });
  5. #5
    Thanks Danil,
    It solved the problem.

Similar Threads

  1. Dynamically loading Store problem at runtime
    By marcelorosait in forum 1.x Help
    Replies: 14
    Last Post: Feb 14, 2012, 9:33 AM
  2. Replies: 7
    Last Post: Jun 03, 2011, 9:18 PM
  3. Problem with IE6 and loading Store via WebService
    By macap in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Dec 16, 2010, 3:26 PM
  4. Loading one store after another
    By chezinho in forum 1.x Help
    Replies: 0
    Last Post: Nov 11, 2010, 2:33 PM
  5. Two cbx in datagrid, store loading problem ?
    By Jackfr in forum 1.x Help
    Replies: 7
    Last Post: Jul 09, 2009, 10:03 AM

Posting Permissions