Null reference in Ext.container.Container's getRefItems

Support for v6.x of our Scheduling components


Post Reply
User avatar
dimehb
Premium Member
Premium Member
Posts: 276
Joined: Fri Oct 02, 2015 11:06 am

Null reference in Ext.container.Container's getRefItems

Post by dimehb »

Hi,

even though I don't have a test case yet, I believe there's a problem with the scheduler's resource grid's menu in the latest version with Ext 7.1.0 (and 7.2.0 for that matter).

Code: Select all

getRefItems: function(deep) {
        var me = this,
            items = me.items.items, // Error is thrown here
To provide some initial context: this error is thrown when the state on the component is applied on the fly. This will change the ordering and filtering of the columns. Clicking on the header of a column throws the following error:

Code: Select all

Uncaught TypeError: this.getComponentLayout(...).getDockedItems is not a function
    at constructor.getDockedItems ()
    at constructor.getDockingRefItems (
    at constructor.getRefItems
    at constructor.getRefItems
    at constructor.Ext.container.Container.getRefItems
    at constructor.callParent 
    at constructor.getRefItems
    at getItems 
    at constructor._execute
    at constructor.execute
A simple null reference check doesn't cut it because the next error occurs in the Ext.container.DockingContainer's getDockedItems function.

From what I known now, it seems there's an issue with the Sch framework. I have the exact same functionality in an Ext grid and it's working there.

I will definitely try to provide a simple test case but any feedback prior to that would be welcome. Maybe you're already aware of this?

User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 3070
Joined: Fri Apr 01, 2016 11:08 am

Re: Null reference in Ext.container.Container's getRefItems

Post by pmiklashevich »

Hello,

No, we haven't heard about this problem. I don't see any bryntum code involved to the stacktrace you provided. Also I checked the codebase and didn't find any of "RefItems" usage. It can be ExtJS / Application issue. Please try to produce a testcase, so we can investigate.

Thanks,
Pavel
Pavel Miklashevich - Core Developer

User avatar
dimehb
Premium Member
Premium Member
Posts: 276
Joined: Fri Oct 02, 2015 11:06 am

Re: Null reference in Ext.container.Container's getRefItems

Post by dimehb »

Don't ask me how or why, but this override seems to work. It's not pretty and I don't know the repercussions but it'll do for now.

Code: Select all

Ext.override(Ext.menu.Menu, {
    getDockedItems: function (selector, beforeBody) {
      const componentLayout = this.getComponentLayout();
        
if (componentLayout && !componentLayout.getDockedItems) componentLayout.getDockedItems = () => []; let dockedItems = componentLayout.getDockedItems('render', beforeBody); if (selector && dockedItems.length) { dockedItems = Ext.ComponentQuery.query(selector, dockedItems); } return dockedItems; } });

Post Reply