-
1 Mar 2012 6:24 AM #1
[4.0.7] 'select' event is fired when a grid is sorted if selection model is CellModel
[4.0.7] 'select' event is fired when a grid is sorted if selection model is CellModel
The simplest use case to reproduce this bug is the following:
I just edited the example in the Ext.grid.Panel doc, in basic gridPanel live preview. Below is the edited code:
So the only changes I made are:Code:Ext.create('Ext.data.Store', { storeId:'simpsonsStore', fields:['name', 'email', 'phone'], data:{'items':[ { 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224" }, { 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234" }, { 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244" }, { 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254" } ]}, proxy: { type: 'memory', reader: { type: 'json', root: 'items' } } }); Ext.create('Ext.grid.Panel', { title: 'Simpsons', store: Ext.data.StoreManager.lookup('simpsonsStore'), columns: [ { header: 'Name', dataIndex: 'name' }, { header: 'Email', dataIndex: 'email', flex: 1 }, { header: 'Phone', dataIndex: 'phone' } ], height: 200, width: 400, renderTo: Ext.getBody(), selType:'cellmodel', listeners:{ 'select':function(cell, rec, row, col) { alert('cell at position ' + row + ' | ' + col + ' was selected'); } } });
- added selType: 'cellmodel' to grid config
- added a select listener that will show a pop-up with the selected cell coordinates when the select event is fired.
Expected behaviour:
- the alert pop-up should be showed only when a cell is clicked/selected
Actual behaviour:
- if a cell was clicked, pressing on one of the table headers to sort the data will trigger the select event and the pop-up will be displayed. Example: click on the first cell: a pop-up with 'cell at position 0 | 0 was selected' will be showed. Then click on 'Email' header to sort the grid, and again the same pop-up will be showed. After that the cell is deselected.
-
1 Mar 2012 2:57 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
This example seems to be working fine in 4.1.0.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
Looks like we can't reproduce the issue or there's a problem in the test case provided.



Reply With Quote