[CLOSED] GridPanel Store Not Loading

  1. #1

    [CLOSED] GridPanel Store Not Loading

    I am trying to load a simple GridPanel with a Store created in code behind. I'm not sure what I'm missing but when I add the Store to the GridPanel it just says "Loading..." and never loads.

    The GridPanel is defined as follows:
    <ext:GridPanel ID="SearchSoftwareGrid" runat="server" MultiSelect="true" Height="224"
        Padding="1" Width="398">
        <ColumnModel>
            <Columns>
                <ext:Column ID="Column4" runat="server" Text="Publisher" Width="45" DataIndex="PUBLISHER"
                    Flex="1" />
                <ext:Column ID="Column5" runat="server" Text="Product" Width="175" DataIndex="PRODUCT" />
                <ext:Column ID="Column6" runat="server" Text="Version" Width="50" DataIndex="PRODUCT_VERSION" />
                <ext:Column ID="Column7" runat="server" Text="Instance Count" Width="85" DataIndex="INSTANCE_COUNT" />
            </Columns>
        </ColumnModel>
        <View>
            <ext:GridView ID="GridView2" runat="server">
                <Plugins>
                    <ext:GridDragDrop ID="GridDragDrop2" runat="server" DragGroup="secondGridDDGroup"
                        DropGroup="firstGridDDGroup" />
                </Plugins>
                <Listeners>
                    <Refresh Handler="#{SearchSoftwareGrid}.body.unmask(); #{btnSearchSoftware}.enable();"
                        Delay="1" />
                </Listeners>
            </ext:GridView>
        </View>
    </ext:GridPanel>
    This is the method I use to create the Store in code behind:
    private Ext.Net.Store GetSoftwareStore(string search)
    {
        string proxyUrl = softwareUrl + search;
            
        Ext.Net.Model softwareStoreModel = new Ext.Net.Model();
        softwareStoreModel.Fields.Add(new Ext.Net.ModelField("PUBLISHER", ModelFieldType.String));
        softwareStoreModel.Fields.Add(new Ext.Net.ModelField("PRODUCT", ModelFieldType.String));
        softwareStoreModel.Fields.Add(new Ext.Net.ModelField("PRODUCT_VERSION", ModelFieldType.String));
        softwareStoreModel.Fields.Add(new Ext.Net.ModelField("INSTANCE_COUNT", ModelFieldType.String)); 
            
        Ext.Net.Store resultStore = new Ext.Net.Store()
        {
            AutoLoad = true,
            Proxy =
            {
                new Ext.Net.AjaxProxy()
                {
                    Json = true,
                    ActionMethods = { Read = Ext.Net.HttpMethod.POST, Create = Ext.Net.HttpMethod.POST },
                    Url = proxyUrl,
                    Headers = {
                        new Ext.Net.Parameter("Accept", "application/json"),
                        new Ext.Net.Parameter("Content-Type", "application/json")
                    },
                    Reader = { new Ext.Net.JsonReader() { Root = "" } },
                    Writer = { new Ext.Net.JsonWriter() { Root = "", Encode = true } }
                }
            }
        };
        resultStore.Model.Add(softwareStoreModel);
    
        return resultStore;
    }
    I try to add the Store like this, where txtSearchsoftware is entered by the user and is used to populate the proxyUrl above:
    SearchSoftwareGrid.Store.Add(GetSoftwareStore(txtSearchsoftware.Text));
    The proxyUrl is for a web service that returns some JSON. Example:
    I know the web service is fine because it returns correctly using Fiddler.
    Last edited by Daniil; Oct 04, 2013 at 5:46 AM. Reason: [CLOSED]
  2. #2
    Hi @elisa,

    Please post a service's response.

    Are you sure the Reader's Root should an empty string?
    Reader = { new Ext.Net.JsonReader() { Root = "" } }

Similar Threads

  1. [CLOSED] Store finished loading event ?
    By CarWise in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 14, 2012, 1:18 PM
  2. [CLOSED] Is Store Loading Problem
    By jesperhp in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 09, 2011, 9:25 AM
  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

Tags for this Thread

Posting Permissions