Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Apr 2011
    Location
    Spain
    Posts
    77
    Vote Rating
    1
    Fanny144 is on a distinguished road

      0  

    Default Selection model grid, selection rowModel

    Selection model grid, selection rowModel


    When a grid has a unique record and I select it, if after I deselect it, the deselect event of the selection model (in this case rowModel) occurs but the row continues with the blue color as when it was selected.

    Is there a default property that selects the first record of a record??

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    57
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    I don't understand "Is there a default property that selects the first record of a record?"

    But deselection works fine. Go to the array-grid example. Select the first row. Press the space bar and it deselects, and the highlight colour goes away.

  3. #3
    Sencha User
    Join Date
    Apr 2011
    Location
    Spain
    Posts
    77
    Vote Rating
    1
    Fanny144 is on a distinguished road

      0  

    Default


    Sorry, I meant :

    Is there a default property that selects the first record of a grid??

    Why you have to press the space bar and don't click on the same record??

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    57
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Clicking selects.

    To select the first row of a grid, use a refresh listener on the View, and in the handler, select the first record.

  5. #5
    Sencha Premium Member
    Join Date
    Jun 2011
    Posts
    3
    Vote Rating
    0
    James.M.Bailey is on a distinguished road

      0  

    Default


    Quote Originally Posted by Animal View Post
    But deselection works fine. Go to the array-grid example. Select the first row. Press the space bar and it deselects, and the highlight colour goes away.
    If you take your referenced example, and add the following to the grid for programmatic deselection:
    listeners: {
    select: function(rowSM, record, index, opts) {
    deselect(index);
    }
    }

    the color does not go away. Programmatically calling deselect(index) makes the row selectable again, but the highlight color remains.

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,050
    Vote Rating
    658
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    I can't reproduce this using the 4.2.x beta:

    Code:
    Ext.require('*');
    
    Ext.define('Company', {
        extend: 'Ext.data.Model',
        fields: [{
            name: 'company'
        }, {
            name: 'price',
            type: 'float',
            convert: null,
            defaultValue: undefined
        }, {
            name: 'change',
            type: 'float',
            convert: null,
            defaultValue: undefined
        }, {
            name: 'pctChange',
            type: 'float',
            convert: null,
            defaultValue: undefined
        }, {
            name: 'lastChange',
            type: 'date',
            dateFormat: 'n/j h:ia',
            defaultValue: undefined
        }],
        idProperty: 'company'
    });
    
    Ext.onReady(function() {
        var myData = [['3m Co', 71.72, 0.02, 0.03, '9/1 12:00am']];
    
        // create the data store
        var store = Ext.create('Ext.data.ArrayStore', {
            model: 'Company',
            data: myData
        });
    
        // create the Grid
        var grid = Ext.create('Ext.grid.Panel', {
            store: store,
            columns: [{
                text: 'Company',
                flex: 1,
                sortable: false,
                dataIndex: 'company'
            }, {
                text: 'Price',
                width: 75,
                sortable: true,
                renderer: 'usMoney',
                dataIndex: 'price'
            }],
            height: 350,
            width: 600,
            renderTo: document.body,
        });
    
        var sm = grid.getView().getSelectionModel();
        setTimeout(function() {
            sm.select(0);
            setTimeout(function() {
                sm.deselect(0);
            }, 1000);
        }, 1000);
    });
    This thread is fairly old, so if you feel there's still an issue please open a new thread and follow the reporting template which you can find here: http://www.sencha.com/forum/showthre...o-report-a-bug
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  7. #7
    Sencha Premium Member
    Join Date
    Jun 2011
    Posts
    3
    Vote Rating
    0
    James.M.Bailey is on a distinguished road

      0  

    Default


    Thanks for your reply Evant, I'm satisfied it has been corrected then. I first saw it in 4.1.3, and used Sencha's Try to test it using 4.1.1 here http://try.sencha.com/extjs/4.1.1/co...id/viewer.html, I only commented because the original message was a two-part... this being unanswered until now.

    Much obliged.