-
24 Oct 2012 11:28 PM #1
Grid row update steals current focus.
Grid row update steals current focus.
REQUIRED INFORMATION
Ext version tested:- Ext 4.1.2
- Chrome 22.0.1229.94
Grid row is focused when it is updated by store. This steals the focus from the currently focused field.
Steps to reproduce the problem:- The sample code shows the problem
- The focus would be kept in the text field.
- The text field is no longer focused.
HELPFUL INFORMATIONCode:Ext.onReady(function() { var grid = Ext.create('Ext.grid.Panel', { width: 600, store: { fields: ['id', 'value'], data: [ {id: 1, value: 'Initial value'}, {id: 2, value: 'Initial value'} ] }, columns: [ {text: 'id', dataIndex: 'id'}, {text: 'value', dataIndex: 'value', flex: 1} ], renderTo: Ext.getBody() }); var form = Ext.create('Ext.form.Panel', { title: 'Form', bodyPadding: 5, width: 600, layout: 'anchor', defaultType: 'textfield', items: [ { fieldLabel: 'value', name: 'value', anchor: '100%' }] }); new Ext.container.Viewport( { layout: 'auto', items: [ grid, form ] }); form.down('.textfield').focus(); grid.getSelectionModel().select(0); // ExtJS 4.1.1 Bug: select a row, update record, selection will be lost. setTimeout(function() { grid.getStore().getRange(0, 0)[0].set('value', 'Updated value'); }, 1000); });
Debugging already done:- none
- not provided
- only default ext-all.css
- Windows 7
-
26 Oct 2012 11:39 AM #2
I am working on this now
-
26 Oct 2012 1:48 PM #3
I can not reproduce this issue, I tested in 4.1.2, it is working.
I also tested in 4.1.3, it works, I can only reproduce this issue in 4.1.1
-
28 Oct 2012 4:20 PM #4
Agreed with Kevin, I cannot reproduce this in the latest code.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
29 Oct 2012 12:17 AM #5
For me it still does the same with the 4.1.3 version. After 1 second the focus is no longer in the text field.
You mean that for you the focus stays on that field?
I tested this with Firefox (14.0.1) and IE9 and I got the same result.
-
30 Oct 2012 7:34 AM #6
I got the same Problem and the provided Test Case is triggering this Issue.
Firefox 16.0.2
Ext 4.1.3
Win7
I added a slightly modified TestCase. It is impossible for me to type '123' in one go into the TextField.
Code:<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title> InfoBar Example </title> <link rel="stylesheet" type="text/css" href="./ext-4.1.3/resources/css/ext-all.css"> <script type="text/javascript" src="./ext-4.1.3/ext-all-debug.js"></script> <script type="text/javascript"> Ext.onReady(function() { var grid = Ext.create('Ext.grid.Panel', { width: 600, store: { fields: ['id', 'value'], data: [ {id: 1, value: 'Initial value'}, {id: 2, value: 'Initial value'} ] }, columns: [ {text: 'id', dataIndex: 'id'}, {text: 'value', dataIndex: 'value', flex: 1} ], renderTo: Ext.getBody() }); var form = Ext.create('Ext.form.Panel', { title: 'Form', bodyPadding: 5, width: 600, layout: 'anchor', defaultType: 'textfield', items: [ { fieldLabel: 'value', name: 'value', anchor: '100%' }] }); new Ext.container.Viewport( { layout: 'auto', items: [ grid, form ] }); form.down('.textfield').focus(); grid.getSelectionModel().select(0); form.down('.textfield').on('change', function(field, newVal, oldVal){ grid.getStore().getRange(0, 0)[0].set('value', newVal); }); }); </script> </head> <body> </body> </html>Last edited by Jan Pogadl; 30 Oct 2012 at 7:54 AM. Reason: added a modified TestCase
-
5 Nov 2012 12:04 AM #7
Any chance of reopening this issue as this still occurs with 4.1.3?
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote