Ext.NET icon indicating copy to clipboard operation
Ext.NET copied to clipboard

absent: ext-panel's HeaderConfig inner block

Open fabriciomurta opened this issue 5 years ago • 0 comments

Found: Ext.NET 7.0.0-preview4_2020-07-18.

This was actually reproduced with an ext-window component, at the Color Picker > Advanced > Components example, but according to Ext JS documentation on Ext.window.Window.header, the configuration comes from Ext.panel.Panel.header.

In the example, the block would be directly translated as:

<headerconfig>
    <items>
        <ext-component cls="x-panel-header-title-default-framed" html="Color button &#8680;" />
        <ext-colorbutton width="15" height="15" bindstring="{color}">
            <listeners>
                <change fn="onChange" />
            </listeners>
        </ext-colorbutton>
    </items>
</headerconfig>

It seems a working conversion would be:

<header>
    <ext-header>
        <items>
            <ext-component cls="x-panel-header-title-default-framed" html="Color button &#8680;" />
            <ext-colorbutton width="15" height="15" bindstring="{color}">
                <listeners>
                    <change fn="onChange" />
                </listeners>
            </ext-colorbutton>
        </items>
    </ext-header>
</header>

Which looks unnecessarily longer/deeper than Ext.NET 5's.

Ext.NET 5 favors using simpler blocks unless extension is to be supported. For instance <HeaderConfig /> always means an ext:Header, whereas a <Store> will mean a "SingleStoreCollection" where it could take any instance of Ext.Net.AbstractStore.

This means the <HeaderConfig /> in Ext.NET won't accept extension whereas <Store /> would; and that's the reason the double recursion for latter while the former is determined straight away.

In fact, Ext.NET solution's SingleStoreCollection could take more than one store in markup and that would be accepted. When the code is rendered though, an exception would be thrown stating only one store may be within the "collection".

WebForms examples matching HeaderConfig

  1. ColorPicker > Advanced > Components
  2. TreePanel > List > Overview

MVC examples matching HeaderConfig

  1. TreePanel > List > Overview

fabriciomurta avatar Jul 20 '20 21:07 fabriciomurta