-
3 Jun 2011 3:50 AM #1
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??
-
3 Jun 2011 6:52 AM #2
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.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
3 Jun 2011 6:59 AM #3
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??
-
3 Jun 2011 12:30 PM #4
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.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
8 Jan 2013 10:31 AM #5
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.
-
8 Jan 2013 5:14 PM #6
I can't reproduce this using the 4.2.x beta:
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-bugCode: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); });Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
9 Jan 2013 8:11 AM #7
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.
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote