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

Thread: Problem with Action Column in Ext-Js 4.2

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-9288 in a recent build.
  1. #1
    Ext JS Premium Member
    Join Date
    Dec 2010
    Posts
    37

    Default Problem with Action Column in Ext-Js 4.2

    Hi,

    While we are migrating our application from Ext-Js 4.0.7 to 4.2 (663 build), we found a behavioural difference for Action Column implementation, and the description for the same is

    When we click on action column the entire row is focused, it is trying to raise the row selection event, where as in 4.0.7 the row was not selected even though I click on Action Column, which is leading to the major changes in our application. Is there any alternate solution to avoid the code change in multiple places by using any property which should stop the row selection event when we clicks on action column.

    You can refere the same thing in both version examples

    in 4.0.7 (ext-4.0.7-gpl\examples\grid\array-grid.html)
    in 4.2 (\ext-4.2.0.663\examples\aria\aria-grid.html).


    Thank You in Advance.


    Regards
    Mahesh

  2. #2
    Ext JS Premium Member
    Join Date
    Oct 2007
    Posts
    38

    Default

    Hi,

    Take a look at the stopSelection config of the actioncolumn.

    Danny

  3. #3
    Ext JS Premium Member
    Join Date
    Dec 2010
    Posts
    37

    Default

    Hi Danny, thank you for your response , but this stopSelection is by default set to true, it is not working even though I explictly set it to ture.


    Mahesh

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,450

    Default

    I can confirm this, by default the clicking on the action column should not select the row but is. I will move to the bugs forum and open a ticket for this.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  5. #5
    Sencha Premium User
    Join Date
    Jan 2013
    Posts
    62

    Default

    I thought I was going crazy because of this. Good to know it's actually a bug.

  6. #6
    Sencha User
    Join Date
    Nov 2007
    Posts
    29

    Default

    Is there an override available to solve this until 4.2.1 is released?

  7. #7
    Ext JS Premium Member
    Join Date
    Dec 2010
    Posts
    37

    Default

    over ride the below method with the following code, Highlighted line is the temp fix we are using for the same

    Code:
     /**
         * @private
         * Process and refire events routed from the GridView's processEvent method.
         * Also fires any configured click handlers. By default, cancels the mousedown event to prevent selection.
         * Returns the event handler's status to allow canceling of GridView's bubbling process.
         */
        processEvent : function(type, view, cell, recordIndex, cellIndex, e, record, row){
            var me = this,
                target = e.getTarget(),
                match,
                item, fn,
                key = type == 'keydown' && e.getKey(),
                disabled;
    
    
            // If the target was not within a cell (ie it's a keydown event from the View), then
            // rely on the selection data injected by View.processUIEvent to grab the
            // first action icon from the selected cell.
            if (key && !Ext.fly(target).findParent(view.getCellSelector())) {
                target = Ext.fly(cell).down('.' + Ext.baseCSSPrefix + 'action-col-icon', true);
            }
    
    
            // NOTE: The statement below tests the truthiness of an assignment.
            if (target && (match = target.className.match(me.actionIdRe))) {
                item = me.items[parseInt(match[1], 10)];
                disabled = item.disabled || (item.isDisabled ? item.isDisabled.call(item.scope || me.origScope || me, view, recordIndex, cellIndex, item, record) : false);
                if (item && !disabled) {
                    if (type == 'click' || (key == e.ENTER || key == e.SPACE)) {
                        fn = item.handler || me.handler;
                        if (fn) {
                            fn.call(item.scope || me.origScope || me, view, recordIndex, cellIndex, item, e, record, row);
                        }
     return false;
                    } else if (type == 'mousedown' && item.stopSelection !== false) {
                        return false;
                    }
                }
            }
            return me.callParent(arguments);
        }

  8. #8
    Sencha User
    Join Date
    Nov 2007
    Posts
    29

    Default

    Thank you mahesh_yamsani, I really appreciate it!

    The override worked great!

  9. #9
    Sencha Premium Member
    Join Date
    Nov 2013
    Location
    Tolmin, Slovenia
    Posts
    43

    Default Reproducible in 4.2.2, proposed override doesn't help

    Hi,

    I stumbled upon this problem in 4.2.2 as well and tried to override processEvent as proposed above.

    The override did not solve this behaviour.

    Next thing I tried to use the latest function from 4.3.2.1364 beta in the override without success: the item is still selected when clicking on action column and my on 'select' function is called as well.

    I guess that in 4.2.2 just changing processEvent in Ext.grid.column.Action is not enough to make stopSelection work as expected.

    Any hints how to work around this before the next release of ExtJS?

  10. #10
    Sencha User
    Join Date
    Oct 2010
    Location
    St. Louis, Missouri
    Posts
    55

    Default

    I'm having this issue in 4.2.2 as well.

    Has anyone had any success with a workaround?

Page 1 of 2 12 LastLast

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
  •