[CLOSED] JavaScript Error when adding Store to a Bin

  1. #1

    [CLOSED] JavaScript Error when adding Store to a Bin

    I've hit an issue with adding a Store to the Bin collection of either a Window, Panel or Portal component. I've only been able to make it work if I add the Store to a Portlet Bin, but that is too low level as I need this store shared by various Portlets.

    To reproduce the error, simply create a Window with a Portal in it and Portlets in this portal. When a store is added to the Window or Portal, the following error is produced.

    Unhandled exception at line 73294, column 9 in http://localhost:53972/extjs/ext-all...xt.axd?v=28616

    0x800a138f - JavaScript runtime error: Unable to get property 'items' of undefined or null reference

    load: function(options) {
            var me = this;
    
            options = options || {};
    
            if (typeof options == 'function') {
                options = {
                    callback: options
                };
            }
    
            options.groupers = options.groupers ||  me.groupers.items; <========= ERROR HAPPENS IN THIS LINE
            options.page = options.page || me.currentPage;
            options.start = (options.start !== undefined) ? options.start : (options.page - 1) * me.pageSize;
            options.limit = options.limit || me.pageSize;
            options.addRecords = options.addRecords || false;
    
            if (me.buffered) {
                options.limit = me.viewSize || me.defaultViewSize;
                return me.loadToPrefetch(options);
            }
            return me.callParent([options]);
        },
    Last edited by Daniil; Mar 11, 2014 at 6:39 AM. Reason: [CLOSED]
  2. #2
    Hi @CarlosG,

    I cannot reproduce with this sample. Please provide your one.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Panel runat="server" Title="Panel">
                <Bin>
                    <ext:Store runat="server">
                        <Model>
                            <ext:Model runat="server">
                                <Fields>
                                    <ext:ModelField Name="someField" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Bin>
            </ext:Panel>
        </form>
    </body>
    </html>
  3. #3
    Hi @Daniil,

    I'll post the code in a minute, it's made up of a few items distributed in various files.

    In the meantime, would you mind trying to change the Panel by a Portal and see if you get the error?

    Thanks.
  4. #4
    It appears to be OK with a Portlet as well. Your turn:)

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Portal runat="server">
                <Items>
                    <ext:PortalColumn runat="server">
                        <Items>
                            <ext:Portlet runat="server" Title="Portlet">
                                <Bin>
                                    <ext:Store runat="server">
                                        <Model>
                                            <ext:Model runat="server">
                                                <Fields>
                                                    <ext:ModelField Name="someField" />
                                                </Fields>
                                            </ext:Model>
                                        </Model>
                                    </ext:Store>
                                </Bin>
                            </ext:Portlet>
                        </Items>
                    </ext:PortalColumn>
                </Items>
            </ext:Portal>
        </form>
    </body>
    </html>
  5. #5
    Hi Daniil,

    I tried your example in a new project and as expected, it all worked without problem.

    There must be something specific to my project that is triggering that condition.

    It is very strange because all things being equal and without changing anything, if I instantiate the Store within the Portlet, it all works well, but as soon as I move that instance to the Portal Bin, the error pops up again.

    I'll have to do a bit more debugging. I wonder if it has to do with the fact that I'm working with a Desktop as the main Container or that all elements are being built in Code Behind.

    Thank you for looking into this anyway. If I ever find out what is causing the issue, I'll let you know.
  6. #6
    Maybe, this could help to prepare a sample.
    http://forums.ext.net/showthread.php...ll=1#post56687

Similar Threads

  1. Replies: 2
    Last Post: Jun 06, 2012, 8:27 PM
  2. Replies: 2
    Last Post: Jun 06, 2012, 8:27 PM
  3. Replies: 4
    Last Post: Mar 30, 2012, 7:30 PM
  4. Replies: 12
    Last Post: Sep 20, 2011, 2:33 PM
  5. [CLOSED] Adding Fields to Store from Javascript
    By pcole01 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 04, 2011, 4:21 PM

Posting Permissions