Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Ext.Net.ColumnBase.Editor doesn't support LazyMode.Config #1870

Open
fabriciomurta opened this issue Jan 14, 2022 · 0 comments
Open

Ext.Net.ColumnBase.Editor doesn't support LazyMode.Config #1870

fabriciomurta opened this issue Jan 14, 2022 · 0 comments
Milestone

Comments

@fabriciomurta
Copy link
Contributor

Found: 5.3.0
Ext.NET Forums' thread: Stateful grid with cell editing - reconfiguration causes the cell editor to be destroyed

GridPanel columns' Editor config doesn't take LazyMode into account when creating its output and always use LazyMode.Instance. In case one needs the columns defined as config objects (LazyMode.Config), for instance to allow using the columns definition to .reconfigure() the grid, the only means is thru CustomConfig passing the editors as server-side instances of the component converted with the .ToConfig() method.

For example in Ext.NET MVC with Razor syntax:

Html.X().Column().Text("Company").DataIndex("company").Flex(1)
    .CustomConfig(c => c.Add(
        new ConfigItem("editor", new Ext.Net.TextField() { AllowBlank = false }.ToConfig(), ParameterMode.Raw))
    ),

So that the column is output as:

{
    "editor": {
        xtype: "textfield",
        validateOnFocusLeave: true,
        allowBlank: false
    },
    flex: 1,
    dataIndex: "company",
    text: "Company"
}

The only currently possible to output the config is instancing the corresponding Ext JS client-side class, which makes it unable to be referenced later e.g. to pass as a parameter to App.GridPanel1.reconfigure(App.GridPanel1.getStore(), App.GridPanel1.getInitialConfig().columns.items). The instance output layout, in contrast with the desired above, is:

{
    flex: 1,
    dataIndex: "company",
    editor: new Ext.grid.CellEditor(Ext.apply({
        field: {
            xtype: "textfield",
            validateOnFocusLeave: true,
            allowBlank: false
        }
    }, {})),
    text: "Company"
}
@fabriciomurta fabriciomurta added this to the 5.x milestone Jan 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant