1. #1
    Sencha User
    Join Date
    Feb 2010
    Posts
    11
    Vote Rating
    0
    dariush is on a distinguished road

      0  

    Default Edit column in grid inline (RowEditingPlugin) with a combobox

    Edit column in grid inline (RowEditingPlugin) with a combobox


    Hi friends,
    I want to edit a grid column using a combobox with architect.
    I searched on the forums and one solution is just setting for that column an editor defined as follow:
    Code:
    {xtype:'combo',                        
      store: new Ext.data.ArrayStore({
      fields: ['abbr', 'action'],
      data : [                                         
         ['suspend', 'Suspend'],
         ['activate', 'Activate'],
         ['update', 'Update'],
         ['delete', 'Delete']
                 ]
           }),
           displayField:'action',
           valueField: 'abbr',
           mode: 'local',
           typeAhead: false,
           triggerAction: 'all',
           lazyRender: true,
           emptyText: 'Select action'
            }
    The problem is that, when I put this code in the 'editor' property, all spaces are trimmed; here the result found in the 'Code' view:
    Code:
    xtype: "combo",
                                    store: newExt.data.ArrayStore({
                                        fields: [
                                            "abbr",
                                            "action"
                                        ],
                                        data: [
                                            [
                                                "suspend",
                                                "Suspend"
                                            ],
                                            [
                                                "activate",
                                                "Activate"
                                            ],
                                            [
                                                "update",
                                                "Update"
                                            ],
                                            [
                                                "delete",
                                                "Delete"
                                            ]
                                        ]
                                    }),
                                    displayField: "action",
                                    valueField: "abbr",
                                    mode: "local",
                                    typeAhead: false,
                                    triggerAction: "all",
                                    lazyRender: true,
                                    emptyText: "Select action"
    which obviously doesn't work.
    Any hints to solve the problem?
    In general, is there a way to tell Architect to leave a property exactly as inserted by the programmer?
    Best regards,
    Dariush

  2. #2
    Sencha User
    Join Date
    Feb 2010
    Posts
    11
    Vote Rating
    0
    dariush is on a distinguished road

      0  

    Default


    I've found a workaround for this problem, promoting that column to a class, overriding it and defining manually the 'editor' property.
    Isn't there any easier way to deliver the same function, without overriding?
    Best regards,
    Dariush

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,191
    Vote Rating
    63
    aconran is just really nice aconran is just really nice aconran is just really nice aconran is just really nice aconran is just really nice

      0  

    Default


    The approach you've taken is the currently recommended approach.
    Aaron Conran
    @aconran
    Sencha Architect Development Team