[2.1] GridPanelFor Editor field related to model

  1. #1

    [2.1] GridPanelFor Editor field related to model

    Hi,

    I built a GridPanel using GridPanelFor successfully.
    Now I would add a editor feature to the grid (later I would add a way to save changes).

    I added a CellEditing Plugin, but Editor Field for each column is not defined, because columns are generated form model.
    I also looked for a way to add them in the model, but i did not found that.

    How can i define those fields dinamically, to be generated with the GridPanel from model?

    My GridPanelFor code is

    Html.X().GridPanelFor(Model)
                    .Title("Templs")
                    .Width(700)
                    .Height(500)
    
                    .Plugins(plugins =>
                        {
                            plugins.Add(Html.X().CellEditing()
                                .ID("CellEditing1")
                                .ClicksToEdit(1)
                            );
                        })
        )
    Very similar to the example at mvc.ext.net.
  2. #2
    Unfortunately, Editor cannot be defined in Model
    I can suggest:
    - define it in view
        Html.X().GridPanelFor(...)
             .Control(grid=>{
                     grid.ColumnModel.Column[0].Editor.Add(...);
             })
    - use Editor property of GridPanel, like in the following sample
    https://examples2.ext.net/#/TreePanel/Basic/Editors/
  3. #3
    Ok, I'm watching the TreePanel editor sample to port it to the grid.

    I saw that there are 3 editors defined (text, number, combo).
    I also saw that every node has a CustomAttribute.Add(config item) "editor" with value 0, 1 or 2.

    Does the value is related to the number of editor to use?

    If I use this method in the GridPanelFor control, can i define the configItem of the column in the model?

    What is the
    <ext:ModelField Name="editor" Type="Int" />
    defined in fields?



    Thank you.

Similar Threads

  1. [2.1] GridPanelFor Batch Update
    By millenovanta in forum 2.x Help
    Replies: 20
    Last Post: Dec 26, 2012, 1:27 PM
  2. [CLOSED] CheckBox Selection Model & Row Editor Plugin
    By ljcorreia in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 02, 2012, 7:16 AM
  3. HTMLEditor on Editor Field
    By pankyhehe in forum 1.x Help
    Replies: 0
    Last Post: Dec 29, 2011, 10:03 AM
  4. [CLOSED] Row Editor issue with Checkbox selection model
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Dec 07, 2011, 6:12 PM
  5. Replies: 1
    Last Post: Nov 15, 2011, 6:56 AM

Tags for this Thread

Posting Permissions