Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Aug 9, 2024. It is now read-only.
This repository was archived by the owner on Aug 9, 2024. It is now read-only.

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

Copy link
Copy link
@fabriciomurta

Description

@fabriciomurta
Issue body actions

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"
}
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.