Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TabCloseMenu: plug in no longer works as of Ext.NET 5 #1863

Open
fabriciomurta opened this issue Aug 4, 2021 · 1 comment
Open

TabCloseMenu: plug in no longer works as of Ext.NET 5 #1863

fabriciomurta opened this issue Aug 4, 2021 · 1 comment
Milestone

Comments

@fabriciomurta
Copy link
Contributor

Found: 5.3.0
Ext.NET Forums' thread: Plugin TabCloseMenu - closing the tab does not work

The plug in's functionality has stopped working, possibly between 4.x and 5.x upgrade as, per the override provided along the issue report, now the tab close method should be run over the individual tab panel's tab sub property.

The same applies to both Close Tab and Close Other Tabs options, as well as Close All Tabs. The change provided in the thread works as a work around for the Close Tab menu option.

The example for Ext.NET 5 is Tab Panel > Plugin > TabCloseMenu and no option from the plugin, to close tabs, works.

In the equivalent v4 example though, the plug in closes all tabs on Close Other Tabs and Close All Tabs, and closes none on Close Tab. So it's behavior in v4 is incomplete yet acts differently than v5's.

The support for this plugin is still not implemented for Ext.NET 7, so it only applies to Ext.NET 5.

This issue was first fixed in #1648.

@fabriciomurta fabriciomurta added this to the 5.2.1 milestone Aug 4, 2021
@fabriciomurta
Copy link
Contributor Author

This should get further review but, at first, it fixes all plugin "close tab" alternatives:

Ext.define('gh1863', {
    override: 'Ext.ux.TabCloseMenu',

    // Calls 'closeTab()' instead of 'remove()'
    onClose: function () {
        this.tabPanel.closeTab(this.item.tab);
    },

    // Calls 'closeTab()' instead of 'remove()'
    doClose: function (excludeActive) {
        var items = [];

        this.tabPanel.items.each(function (item) {
            if (item.closable) {
                if (!excludeActive || item !== this.item) {
                    items.push(item.tab);
                }
            }
        }, this);

        Ext.suspendLayouts();
        Ext.Array.forEach(items, function (item) {
            this.tabPanel.closeTab(item);
        }, this);
        Ext.resumeLayouts(true);
    }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant