Results 1 to 2 of 2

Thread: [6.5.2 Modern] List with `selectable: 'multi'` doesn't trigger 'deselect' event

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1

    Default [6.5.2 Modern] List with `selectable: 'multi'` doesn't trigger 'deselect' event

    List with selectable: 'multi' doesn't trigger 'deselect' event when deselect a listitem.

    Ext version tested:
    Ext 6.5.2.463 Modern

    Browser versions tested against:
    Windows7 Chrome 58.0.3029.110

    Fiddle:
    https://fiddle.sencha.com/#view/editor&fiddle/28k6


    BTW:

    For Ext 6.5.0.775 Modern, list need to select and deselect with `ctrl`/`shift` key, but `deselect` event is not fired when deselect an item;

    For Ext 6.5.1.345 Modern, lis can select without `ctrl`/`shift` key, but when deselect an item, all selected items become unselected; if deselect an item with `ctrl` key, `deselect` event is not fired.

  2. #2

    Default I've got a workaround

    The second argument of `deselect` method of `Ext.dataview.selection.Model` is `supressEvent`, not `keepExisting` as `select` method.

    Code:
    Ext.define('Override.dataview.selection.Model', {
        override: 'Ext.dataview.selection.Model',
        
        selectWithEventMulti: function(record, e, isSelected) {
            var me = this,
                shift = e.shiftKey,
                ctrl = e.ctrlKey,
                start = shift ? me.selectionStart : null;
            
            if (shift && start) {
                me.selectRange(start, record, ctrl);
            } else {
                //here
                if(isSelected) me.deselect(record);
                else me.select(record, true);
                //me[isSelected ? 'deselect' : 'select'](record, true);
            }
        }
    });

Similar Threads

  1. Replies: 2
    Last Post: 22 Nov 2017, 4:33 PM
  2. Replies: 1
    Last Post: 6 Jun 2017, 8:24 AM
  3. Replies: 3
    Last Post: 2 Aug 2013, 8:42 AM
  4. [CLOSED] Ext.mixin.Selectable cannot deselect by passing in an index
    By yoh.suzuki in forum Sencha Touch 2.x: Bugs
    Replies: 2
    Last Post: 16 Jan 2012, 2:40 PM
  5. Combobox list dynamic selector / optional selectable and non selectable item
    By just_a_kid in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 8 Dec 2010, 3:03 AM

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
  •