1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    10
    Vote Rating
    0
    Redsandro is on a distinguished road

      0  

    Question simpleSelect on xtype:grid with selModel: RowSelectionModel -> Possible?

    simpleSelect on xtype:grid with selModel: RowSelectionModel -> Possible?


    I have a grid with an implied default selModel of RowSelectionModel, and implied default setting singleSelect = false, causing you to be able to select multiple rows of data.

    In a gridView, the same would be done using multiSelect = true, which also gives you the optional feature called simpleSelect = true. This makes it so you aren't required to hold ctrl for a multi-selection.

    Is there an easy way to have simpleSelect for a grid with RowSelectionModel? It's not in the documentation, but I was hoping there is a relatively simple trick to enable this. I'd reckon this is a popular feature and I'm probably missing something, but I can't figure it out using google.

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,568
    Vote Rating
    307
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    I don't know of anything simple but here's something that seems to work:

    Code:
    new Ext.grid.GridPanel({
        ...
        listeners: {
            rowmousedown: function(grid, rowIndex, ev) {
                var selModel = grid.getSelectionModel();
    
                if (ev.button !== 0 || selModel.isLocked()){
                    return;
                }
    
                if (selModel.isSelected(rowIndex)) {
                    selModel.deselectRow(rowIndex);
                }
                else {
                    selModel.selectRow(rowIndex, true);
                }
    
                return false;
            }
        }
    });

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    10
    Vote Rating
    0
    Redsandro is on a distinguished road

      0  

    Thumbs up


    Thank you good Sir! This does pretty much exactly the trick.

    I didn't know rowmousedown was a proper event. I did try to look up all available events; the API documentation is awesome, but I have not yet succeeded in securing a list of available events.

    I hope this simple extension will be available in ExtJS 4. Haven't yet migrated to 4 because I figured migrating existing ExtJS 3 code is more work than just keep using 3. For now.

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,568
    Vote Rating
    307
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    That event is definitely documented:

    http://dev.sencha.com/deploy/ext-3.4...grid.GridPanel

    Scroll right down to the bottom... third row up.

  5. #5
    Sencha User
    Join Date
    Jun 2011
    Posts
    10
    Vote Rating
    0
    Redsandro is on a distinguished road

      0  

    Default


    You are right. My bad.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."