Results 1 to 7 of 7

Thread: CellEditing.startEditByPosition requires setTimeout if triggered from ActionColumn

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Mar 2011
    Location
    Arvada, CO
    Posts
    404

    Default CellEditing.startEditByPosition requires setTimeout if triggered from ActionColumn

    I have a grid with an edit button action column, and when I click the edit icon, I want to instantly go into editing for my Name column. The strange thing is, the column gets highlighted, but the cell doesn't go into edit mode. However, if I add a setTimeout around the startEditByPosition method call (commented out in the Fiddle), the column goes into edit mode just fine. I have a feeling it might have to do with the editor losing focus from the action column click. Seems like a bug to me.


  2. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579

    Default

    Looks like it was a bug. Testing this against 6.2.1+ it appears to be resolved.
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Location
    Arvada, CO
    Posts
    404

    Default

    Quote Originally Posted by tristan.lee View Post
    Looks like it was a bug. Testing this against 6.2.1+ it appears to be resolved.
    Thanks for verifying, Tristan. Looks like 6.2.0 has a bunch of bugs introduced... I'm curious, with all of these reported issues that get solved, do you use them for regression testing, so this doesn't come about in newer versions?

  4. #4
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579

    Default

    There's always some sort of unit test included with a change so that we can spot regressions before code is merged. Test cases provided to us by customers are a good start for us to test against. While they aren't included verbatim into our tests, they are often times used as a base test to expand upon.
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  5. #5
    Sencha User
    Join Date
    Mar 2011
    Location
    Arvada, CO
    Posts
    404

    Default

    Quote Originally Posted by tristan.lee View Post
    There's always some sort of unit test included with a change so that we can spot regressions before code is merged. Test cases provided to us by customers are a good start for us to test against. While they aren't included verbatim into our tests, they are often times used as a base test to expand upon.
    Man, y'all have a treasure trove of regression unit tests created for you! I realize they might not be the best quality, but at least a quick run against what was reported in a bug would be more helpful than harm, I'd expect. I realize there are most likely other conditions for why they aren't always used; I just think it seems like a missed opportunity.

    I do appreciate you responding and expanding upon what's done at Sencha though. Thanks!

  6. #6
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256

    Default

    As Tristan said, typically these test cases form the base of what will be transformed into a unit test, however there are a couple of things to take into account.

    1) The unit tests need to be automated, which means they need to fit in with our existing suite of tests. This includes doing this like simulating events and following the structure of other tests.

    2) Typically the test cases that come with bug reports aren't minimal test cases. We want minimal test cases so that we can ensure that we are isolating the bug in it's simplest fashion. There are also performance implications as well, since these tests gets run a lot, we don't want to do extra work when there's no need for it.

    For example, with your attached test case there's a lot that can be cut out and still have the behaviour visible:

    Code:
    Ext.application({
        name: 'Fiddle',
    
        launch: function () {
            var g = new Ext.grid.Panel({
                store: {
                    data: [{
                        name: 'Lisa'
                    }]
                },
                columns: [{
                    xtype: 'actioncolumn',
                    items: [{
                        icon: 'https://cdn0.iconfinder.com/data/icons/back-to-school/90/circle-school-learn-study-subject-math-pencil-edit_2-512.png',
                        handler: function () {
                            g.getPlugin('myPlug').startEditByPosition({
                                row: 0,
                                column: 1
                            });
                        }
                    }]
                }, {
                    dataIndex: 'name',
                    editor: 'textfield'
                }],
                selModel: 'cellmodel',
                plugins: {
                    ptype: 'cellediting',
                    clicksToEdit: 1,
                    pluginId: 'myPlug'
                },
                height: 200,
                width: 400,
                renderTo: Ext.getBody()
            });
        }
    });
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  7. #7
    Sencha User
    Join Date
    Mar 2011
    Location
    Arvada, CO
    Posts
    404

    Default

    Oh, right, I totally forgot about simulating user actions... yeah, makes sense. Thanks for clarifying, evant!

Similar Threads

  1. How to make cellediting tab skip the actioncolumn?
    By jasewell in forum Ext JS 6.x Q&A
    Replies: 1
    Last Post: 5 Apr 2016, 1:11 PM
  2. Replies: 1
    Last Post: 9 Feb 2016, 11:36 AM
  3. Replies: 4
    Last Post: 18 Jan 2013, 12:03 AM
  4. CellEditing startEditByPosition not behaving as expected
    By manticor in forum Ext: Discussion
    Replies: 0
    Last Post: 16 Apr 2012, 10:29 AM

Posting Permissions

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