Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Cell editing not working

  1. #1
    Ext Premium Member halcwb's Avatar
    Join Date
    Mar 2010
    Location
    Rotterdam
    Posts
    402
    Answers
    10

    Default Answered: Cell editing not working

    Somehow I don't get cell editing working in my code. If I run exactly the same test code in a fiddle like below:



    it works fine. But if I run copy paste it and use it in my project, cell editing fails. The cell editing plugin gets created, but somehow no editors get created. Also when adding the below code:

    Code:
    Ext.ComponentQuery.query('cell-editing')[0].plugins[0].on('beforeedit', function () { console.debug('cell editing before event'); })
    works with the Ext cell editing example, works with the in the fiddle, but not using the same code in my project. I am at a loss what is going on. The grid in my projects resides in a container with a border layout.

    P.s. I checked the existence for editor configs on the columns, they do exist. I tried the code in Chrome, strangely, the editing worked for a short while, after a first try and then stopped working??? Cleared the cache, same problem, cell editing not getting triggered anymore?????????

  2. There does seem to be a bug related to cellediting on a collapsed panel. There is a similar issue related to cellediting on a collapsed fieldset

    Here are a few recommended changes as well; there were some quirky artifacts when expanding your example on the south region .. not rendering correctly and header remained at bottom

    Code:
    Ext.define('PrescriptionList', {
        extend: 'Ext.grid.Panel',
        alias: 'widget.prescriptionlist',
    
        title: '',
    
        initComponent: function() {
            var me = this;
    
            Ext.applyIf(me, {
                tools: [{
                    xtype: 'tool',
                    type: 'save',
                    handler: function (e, target, owner, me) {
                        var store = me.up('panel').store;
                        console.debug(store);
                        store.add(['']);
                        store.sync();
                    }
                }],
    
                selModel: {
                    selType: 'cellmodel'
                },
                
                store: [ ],
    
                plugins : [{
                    ptype: 'cellediting', // lazy load as well
                    clicksToEdit: 1
                }],
    
                columns: [{
                    dataIndex: 'Generic',
                    header: 'Generic',
                    editor: {
                        xtype: 'textfield'
                    }
    
                }, {
                    dataIndex: 'Concentration',
                    header: 'Concentration',
                    editor: {
                        xtype: 'textfield' // shorten code for now
                    }
                }]
            });
    
            this.callParent();
        }
    });
    
    Ext.define('My.Viewport', {
        extend: 'Ext.container.Viewport',
    
        layout: 'border',
    
        initComponent: function() {
            var me = this;
    
            // removed unused regions
            Ext.applyIf(me, {
                items: [{
                    title: 'South',
                    region: 'south',
                    collapsed: true,
                    collapsible: true,
                    // needs a height
                    height: 200,
                    split: true,
                    items: [{
                        xtype: 'prescriptionlist'
                    }]
                }, {
                    title: 'Center',
                    region: 'center'
                    // flex: 1 // not needed on center
                }]
            });
    
            me.callParent(arguments);
        }
    
    });
    
    Ext.application({
        name: 'Fiddle',
    
        launch: function() {
            Ext.create('My.Viewport', {
               // renderTo: Ext.getBody() // not needed on viewport
            });
        }
    });
    I would highly recommend upgrade to our latest version as there were many fixes

    Scott.

  3. #2
    Ext Premium Member halcwb's Avatar
    Join Date
    Mar 2010
    Location
    Rotterdam
    Posts
    402
    Answers
    10

    Default Cell editing is not working when on collapsed panel

    Setting collapsed to false on the collapsible grid panel solved the problem. However, either I am doing something stupid or it is a bug. In the last case (also in the first) I am not too happy about this as I lost precious hours in trying to solve this problem.

  4. #3
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    Ext.ComponentQuery.query('cell-editing')[0].plugins[0].on('beforeedit'
    That sure is a busy approach to get access. Have you tried assigning it to a variable, or just using something like

    Code:
    grid.getPlugin('mycellediting'); // assign plugin id when creating plugin
    Code:
    buildPlugins : function () {
        return [
            {
                ptype              : 'cellediting',
                pluginId           : 'mycellediting',
            }
        ]
    },

  5. #4
    Ext Premium Member halcwb's Avatar
    Join Date
    Mar 2010
    Location
    Rotterdam
    Posts
    402
    Answers
    10

    Default

    Quote Originally Posted by scottmartin View Post
    That sure is a busy approach to get access. Have you tried assigning it to a variable, or just using something like

    Code:
    grid.getPlugin('mycellediting'); // assign plugin id when creating plugin
    Code:
    buildPlugins : function () {
        return [
            {
                ptype              : 'cellediting',
                pluginId           : 'mycellediting',
            }
        ]
    },
    The access is not the issue, the access was just quick and dirty to check the plugin. I do not need to access the plugin at all, I just use the events to get to the required objects/data.

    The problem is that editors are not created for columns when the grid is on a collapsed panel. So, then the cell editing is not working. Thats the issue. I tried assigning a pluginId, but that did not resolve the problem. The only way to avoid is, is to set collapsed to false on the container of the grid. But I think this is a bug.

  6. #5
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    I can appreciate your position, but since you cannot duplicate this on a fiddle, then there is another problem.

    I would try the following:

    -remove the custom UX from the mix .. test with a textfield
    -check for any custom overrides that may be causing this to break
    -verify your version and make sure you are not using CSS from older version
    -break the code down to simplest form and just try to isolate the problem.
    -you store array is suspect: store: [[]], are you assigning this later?

    If you have something we can look at that duplicates the problem, it would be much easier.

  7. #6
    Ext Premium Member halcwb's Avatar
    Join Date
    Mar 2010
    Location
    Rotterdam
    Posts
    402
    Answers
    10

    Default

    Quote Originally Posted by scottmartin View Post
    I can appreciate your position, but since you cannot duplicate this on a fiddle, then there is another problem.

    I would try the following:

    -remove the custom UX from the mix .. test with a textfield
    -check for any custom overrides that may be causing this to break
    -verify your version and make sure you are not using CSS from older version
    -break the code down to simplest form and just try to isolate the problem.
    -you store array is suspect: store: [[]], are you assigning this later?

    If you have something we can look at that duplicates the problem, it would be much easier.
    I already have gone through all the steps you mention. No luck, also I tried to reproduce the problem in the fiddle, no luck. I have updated the fiddle by putting the grid in a container that is collapsed, but in the fiddle this causes not the same problem as in my project code.

  8. #7
    Ext Premium Member halcwb's Avatar
    Join Date
    Mar 2010
    Location
    Rotterdam
    Posts
    402
    Answers
    10

    Default Its a bug, in Ext 4.2.0

    It's definitely a bug, I have reproduced the problem by setting the above fiddle to Ext version 4.2.0 (the one I am using currently). Adding a record to the store with the grid initially collapsed, and you see what I mean, just run the fiddle in version 4.2.0. Setting the fiddle to a later version, and the editors show up.

  9. #8
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    There does seem to be a bug related to cellediting on a collapsed panel. There is a similar issue related to cellediting on a collapsed fieldset

    Here are a few recommended changes as well; there were some quirky artifacts when expanding your example on the south region .. not rendering correctly and header remained at bottom

    Code:
    Ext.define('PrescriptionList', {
        extend: 'Ext.grid.Panel',
        alias: 'widget.prescriptionlist',
    
        title: '',
    
        initComponent: function() {
            var me = this;
    
            Ext.applyIf(me, {
                tools: [{
                    xtype: 'tool',
                    type: 'save',
                    handler: function (e, target, owner, me) {
                        var store = me.up('panel').store;
                        console.debug(store);
                        store.add(['']);
                        store.sync();
                    }
                }],
    
                selModel: {
                    selType: 'cellmodel'
                },
                
                store: [ ],
    
                plugins : [{
                    ptype: 'cellediting', // lazy load as well
                    clicksToEdit: 1
                }],
    
                columns: [{
                    dataIndex: 'Generic',
                    header: 'Generic',
                    editor: {
                        xtype: 'textfield'
                    }
    
                }, {
                    dataIndex: 'Concentration',
                    header: 'Concentration',
                    editor: {
                        xtype: 'textfield' // shorten code for now
                    }
                }]
            });
    
            this.callParent();
        }
    });
    
    Ext.define('My.Viewport', {
        extend: 'Ext.container.Viewport',
    
        layout: 'border',
    
        initComponent: function() {
            var me = this;
    
            // removed unused regions
            Ext.applyIf(me, {
                items: [{
                    title: 'South',
                    region: 'south',
                    collapsed: true,
                    collapsible: true,
                    // needs a height
                    height: 200,
                    split: true,
                    items: [{
                        xtype: 'prescriptionlist'
                    }]
                }, {
                    title: 'Center',
                    region: 'center'
                    // flex: 1 // not needed on center
                }]
            });
    
            me.callParent(arguments);
        }
    
    });
    
    Ext.application({
        name: 'Fiddle',
    
        launch: function() {
            Ext.create('My.Viewport', {
               // renderTo: Ext.getBody() // not needed on viewport
            });
        }
    });
    I would highly recommend upgrade to our latest version as there were many fixes

    Scott.

  10. #9
    Ext Premium Member halcwb's Avatar
    Join Date
    Mar 2010
    Location
    Rotterdam
    Posts
    402
    Answers
    10

    Default

    Quote Originally Posted by scottmartin View Post
    There does seem to be a bug related to cellediting on a collapsed panel. There is a similar issue related to cellediting on a collapsed fieldset

    Here are a few recommended changes as well; there were some quirky artifacts when expanding your example on the south region .. not rendering correctly and header remained at bottom

    I would highly recommend upgrade to our latest version as there were many fixes

    Scott.
    Unfortunately, I do not have access to your latest version, i.e. bug fixes. So, for now I will live with it. The code in the fiddle is not production code and changing a customized field to a regular text field is just not an option for my application.

    I hope that the latest more bug free version is released to the general public. Is there any indication when this will be done? I am working on an open source project, so, I just do not have the funding to get a payed prescription to your framework.

  11. #10
    Ext Premium Member halcwb's Avatar
    Join Date
    Mar 2010
    Location
    Rotterdam
    Posts
    402
    Answers
    10

    Default

    Quote Originally Posted by scottmartin View Post
    There does seem to be a bug related to cellediting on a collapsed panel. There is a similar issue related to cellediting on a collapsed fieldset

    Here are a few recommended changes as well; there were some quirky artifacts when expanding your example on the south region .. not rendering correctly and header remained at bottom


    I would highly recommend upgrade to our latest version as there were many fixes

    Scott.
    I am sorry, but this was not a good advice, therefore, -1.

    I upgraded to 4.2.1.833 (the latest I can get my hands on) and immediately ran into major rendering issues I did not have in the previous 4.2.0.633 version. The grouping feature (I heavily rely on was broken), see the reported bug on this. This was reported in May, about half a year ago. Furthermore, rendering of form fields in nested fieldset layouts are broken. I did update the reference to the 4.2.1.833 css file.

    Am I overlooking the obvious (in which case you can give me the -1;-) or should I wait for the public release of 4.2.2?

Page 1 of 2 12 LastLast

Posting Permissions

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