[CLOSED] Unable to get property 'isCollapsedPlaceholder' of undefined or null reference

  1. #1

    [CLOSED] Unable to get property 'isCollapsedPlaceholder' of undefined or null reference

    I am out of my depth on this one. I am not sure what is causing this error as it was not happening before I upgraded to Ext.Net.MVC v 2.5.1
    The only similar post I can find is http://forums.ext.net/showthread.php...t-error-(Bug-) which has the same area of the code that is highlighted in my error.

    Do you have any idea what part of my code I would need to post to help in solving this? The error occurs when there are multiple windows open and multiple grids on each window. I am only able to get the error to happen sporadically and even then I am having trouble locating commonalities in the different times it occurs. Any help would be appreciated.
    Last edited by Daniil; May 06, 2014 at 7:00 AM. Reason: [CLOSED]
  2. #2
    I guess the the error occurs in grid with Grouping plugin
    Can you post stack trace of that error?

    Please ensure that you use debug version of scripts before stack trace posting
    Last edited by geoffrey.mcgill; Apr 25, 2014 at 3:56 AM.
  3. #3
    I am putting together the stack trace for you. I am not using any plugins in any of the grids, and recreating the error for the stack trace is not consistant. I should have something for you soon.
  4. #4
    The error only seems to happen after I have been using the grid a bit. Never on the first click of a button. The error can occur on scrolling, mouse over, click and probably some other interactions.

    Here is the stack trace:

    Ext.view.Table.override.indexInStore (ext.axd?v=31188:1476)
    Ext.cmd.derive.processUIEvent (ext.axd?v=31188:18)
    b.implement.callParent (ext.axd?v=31188:18)
    Ext.view.Table.override.processUIEvent (ext.axd?v=31188:1464)
    Ext.cmd.derive.handleEvent (ext.axd?v=31188:18)
    Ext.view.View.override.handleMouseOverOrOut (ext.axd?v=31188:1500)
    (anonymous function) (ext.axd?v=31188:18)
    The error is taking place in the Ext.view.Table.override.indexInStore area.
    some more detail:
    <exception>: TypeError
    message: "Cannot read property 'isCollapsedPlaceholder' of undefined"
    stack: "TypeError: Cannot read property 'isCollapsedPlaceholder' of undefined↵    at Ext.view.Table.override.indexInStore (http://localhost:51790/extnet/extnet-all-js/ext.axd?v=31188:1476:55)↵    at Ext.cmd.derive.processUIEvent (http://localhost:51790/extjs/ext-all-js/ext.axd?v=31188:18:1059284)↵    at b.implement.callParent (http://localhost:51790/extjs/ext-all-js/ext.axd?v=31188:18:50639)↵    at Ext.view.Table.override.processUIEvent (http://localhost:51790/extnet/extnet-all-js/ext.axd?v=31188:1464:13)↵    at Ext.cmd.derive.handleEvent (http://localhost:51790/extjs/ext-all-js/ext.axd?v=31188:18:1058679)↵    at Ext.view.View.override.handleMouseOverOrOut (http://localhost:51790/extnet/extnet-all-js/ext.axd?v=31188:1500:153)↵    at http://localhost:51790/extjs/ext-all-js/ext.axd?v=31188:18:26457"
    get stack: function () { [native code] }
    arguments: null
    caller: null
    length: 0
    name: ""
    prototype: Object
    __proto__: function Empty() {}
    <function scope>
    set stack: function () { [native code] }
    __proto__: Error
    constructor: function TypeError() { [native code] }
    name: "TypeError"
    stack: undefined
    __proto__: d
    node: undefined
    recordIndex: undefined
    Here is the code for the grid:
    @{
        var X = Html.X();
    }
    @(X.ResourceManager())
    
      <script>
    
            var listener = function (record, command, grid) {
                grid.getSelectionModel().select(record);
                if (command == "ignoreAccount") {
                    Ext.net.DirectMethod.request({
                        url: '@(Url.Action("IgnoreNewAccount", "AlbridgeImport"))',
                        params: { accountNum: record.get("AccountNum") }
                    });
                }
                if (command == "linkToClient") {
                    App.newClientForm.hide();
                    var newAccount = App.NewAccountsGrid.getRowsValues({ selectedOnly: true });
                    var accountNumber = newAccount[0].AccountNum;
                    App.ClientStore.clearFilter();
                    App.newClientWindow.show();
                }
            };
    </script>
     @(X.GridPanel()
            .ID("NewAccountsGrid")
            .Title("Unlinked Accounts as of " + @ViewData["ValueDate"])
            .Width(700)
            .MessageBusListeners(new MessageBusListener
                {
                    Name = "AccountSubmitted",
                    Fn = "reloadAccountsGrid"
                }
            )//messagebus
            .Store(X.Store()
                .ID("NewAccountsStore")
                .Proxy(
                    X.AjaxProxy()
                        .Url(Url.Action("GetNewAccounts"))
                        .Reader(X.JsonReader().Root("data").TotalProperty("total"))
                        .FilterParam("Name")
                )//Proxy
                
                .Model(X.Model()
                    .Fields(
                        new ModelField("AccountNum", ModelFieldType.String),
                        new ModelField("FirstName", ModelFieldType.String),
                        new ModelField("LastName", ModelFieldType.String),
                        new ModelField("AccountType", ModelFieldType.String),
                        new ModelField("AccountName", ModelFieldType.String),
                        new ModelField("TaxStatus", ModelFieldType.String)
                    )//fields
                )//model
            )
            .ColumnModel(
                X.RowNumbererColumn().Flex(1),
                X.Column().Text("Account Number").DataIndex("AccountNum").Flex(2),
                X.Column().Text("First Name").DataIndex("FirstName").Flex(2),
                X.Column().Text("Last Name").DataIndex("LastName").Flex(3),
                X.Column().Text("Account Type").DataIndex("AccountType").Flex(2),
                X.ImageCommandColumn()
                    .Commands(
                        X.ImageCommand()
                            .CommandName("ignoreAccount")
                            .Icon(Icon.Delete)
                            .ToolTip(tt => tt.Text = "Ignore this account"),
                        X.ImageCommand()
                            .CommandName("linkToClient")
                            .Icon(Icon.NoteEdit)
                            .ToolTip(tt => tt.Text = "Link or Create")
                    ).Flex(1)//Commands
                    .Listeners(ls => 
                    {
                        ls.Command.Handler = "listener(record, command, this.up('grid'));";
                    })//Listeners for CommandColumn
            )//ColumnModel
            .View(X.GridView().StripeRows(true).TrackOver(false))
        )
  5. #5
    Please post the indexInStore method where the error occurs. Does it look like this?
    indexInStore: function(node) {
        node = (node && node.isCollapsedPlaceholder) ? this.getNode(node) : this.getNode(node, false);
    
        if (!node && node !== 0) {
            return -1;
        }
    
        var recordIndex = node.getAttribute('data-recordIndex');
    
        if (recordIndex) {
            return parseInt(recordIndex, 10);
        }
    
        return this.dataSource.indexOf(this.getRecord(node));
    }
    Specifically the first line of the function:
    node = (node && node.isCollapsedPlaceholder) ? this.getNode(node) : this.getNode(node, false);
  6. #6
    Here it is:

    indexInStore:function(node) {
        node=node.isCollapsedPlaceholder?this.getNode(node):this.getNode(node,false);
    
        if(!node&&node!==0){
            return-1;
        }
    
        var recordIndex=node.getAttribute('data-recordIndex');
    
        if(recordIndex){
            return parseInt(recordIndex,10);
       }
    
    return this.dataSource.indexOf(this.getRecord(node));}
    So that line you requested is missing the open parenthesis and "node && " as well as the closed parenthesis.
    Last edited by JakeM; Apr 29, 2014 at 3:33 PM.
  7. #7
    That line must be in v2.5.1 release. This bug is one of the main reasons that we did v2.5.1 release. Please ensure there is v2.5.1 dll being applied.
  8. #8
    I have downloaded the dll and updated the reference. I will keep testing to make sure it is fixed. Any idea on why the NuGet update wouldn't have worked?
  9. #9
    Hard to say.

    Could you, please, post the Page Sources? The HTML page rendered to a browser.

Similar Threads

  1. Replies: 3
    Last Post: Mar 13, 2014, 3:58 PM
  2. Replies: 0
    Last Post: Jan 30, 2014, 2:24 PM
  3. Replies: 12
    Last Post: Oct 30, 2013, 6:51 AM
  4. Replies: 0
    Last Post: Oct 26, 2012, 7:48 AM
  5. Replies: 1
    Last Post: Oct 25, 2012, 1:47 PM

Posting Permissions