Results 1 to 4 of 4

Thread: Problem with EditorGridPanel (not Editable)

  1. #1

    Default Problem with EditorGridPanel (not Editable)

    Hi, I have a problem with an editable grid. It works fine, but it not allow me to edit data.
    I checked everything, but can not find the problem.
    Thanks for your help.


    var store = new Ext.data.JsonStore({
    url: paging2.php,
    root: data,
    totalProperty: total, // < total de registros a paginar
    fields: ['fecha','titulo','comentario']
    });

    store.load();

    var textField = new Ext.form.TextField();

    var grid = new Ext.grid.EditorGridPanel({
    store: store,
    columns: [
    new Ext.grid.RowNumberer(),
    {header:'Fecha', dataIndex:'fecha',sortable: true},
    {header:'Ttulo', dataIndex:'titulo',sortable: true, editor:textField},
    {header:'Comentario', dataIndex:'comentario',sortable: true, editor:textField}
    ],
    border: false,
    stripeRows: true
    });

    var win = new Ext.Window({
    title: 'Back-End',
    layout: 'fit',
    width: 510,
    height: 350,
    items: grid
    });

    win.show();

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    You need to create 2 separate editors, one for each column.

  3. #3
    Ext User
    Join Date
    May 2010
    Location
    PTA South Africa
    Posts
    9

    Default

    Hey,

    as condor mentioned, you need a separate editor for each column that needs to be edited. Your code should actually change to something like this...

    Code:
    var grid = new Ext.grid.EditorGridPanel({
         store        : store,
         columns    : [
             new Ext.grid.RowNumberer(),
            {
                header     : 'Fecha',
                dataIndex : 'fecha',
                sortable    : true
            }, {
                header      : 'Ttulo',
                dataIndex  : 'titulo',
                sortable     : true,
                editor        : new Ext.form.TextField()  // creates a new textField for this column
           }, {
                header       : 'Comentario',
                dataIndex   : 'comentario',
                sortable      : true,
                editor         : new Ext.form.TextField()  // creates a new textField for this column
           }
        ],
        border        : false,
        stripeRows  : true
    });

  4. #4

    Default

    I thank you for your help, but still not working. I'm thinking that may have something to do with my localhost.
    I will continue trying.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •