Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    10
    Vote Rating
    1
    doom123 is on a distinguished road

      0  

    Default LIstView with SelectionMode.SIMPLE do not deselects items on click

    LIstView with SelectionMode.SIMPLE do not deselects items on click


    Documentations says about selection modes:


    SIMPLE - Multiple selections without having to use the control and shift keys
    MULTI - Multiple selections


    So, I suppose, SIMPLE mode works the same way as MULTI mode but without ctrl/shift keys.
    I.e. we can select/deselect items just by clicking on them as in MULTI mode with ctrl.


    But it does not work that way: a ListView with SIMPLE selection mode cannot deselect items on click.
    It can only do that by clicking on white space below list items.
    But what if my listview has no this white space. Then deselecting is impossible.


    Is that designed behavior or it is a bug?


    Note,
    1. Tree works expected way, i.e. we can select/deselect items on click in SIMPLE mode.
    2. Noticed, that listview in SIMPLE selection mode still works with ctrl and shift keys. but we cannot use ctrl-click to deselect item

  2. #2
    Sencha Premium Member
    Join Date
    Feb 2011
    Location
    Amsterdam
    Posts
    57
    Vote Rating
    6
    sblommers is infamous around these parts

      0  

    Default


    I am stuck with this just like you. I think it is a bug.

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Sorry to hear this isn't what you wanted, but I'd point out that this is the behavior from 2.x, so I'm not sure about calling it a bug.

    Customizing this should be pretty straightforward. Start by subclassing ListViewSelectionModel (since you are working with a ListView - if you were on a Grid or a Tree, you'd need to pick the right selection model subclass accordingly). This has a method called handleMouseDown which works out what was clicked and how to respond to it (right click, ctrl/shift, etc). Overriding this method could allow you to check if the current index is selected (listView.findElementIndex(target)), and it so, de-select it (by calling select(index, false)).

  4. #4
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    6
    Vote Rating
    0
    aryzhov is on a distinguished road

      0  

    Default


    The bug still exists in GXT 3.0.6. I found a workaround and I posted it here: http://www.sencha.com/forum/showthread.php?268363.