-
26 Mar 2013 7:45 AM #1
4.2.0: drag/drop plugins cause grid focus and scrollbar reset with prevent focus
4.2.0: drag/drop plugins cause grid focus and scrollbar reset with prevent focus
Before add plugins: { ptype: 'gridviewdragdrop' }, with preserveScrollOnRefresh: true, and preventFocus: true, remote grid work fine.
After add plugins: { ptype: 'gridviewdragdrop' }, there are two problems: (1) grid always focus to selected row, not the field user try to type, (2) scrollbar reset to top. Tested with FF and Chrome.
4.1.1a and 3.4.x are fine.
Steps to test:
(1) Load the program,
(2) select any row,
(3) focus to 'Company Name' and type
(4) You will lose focus to 'Company Name' when grid reload data.
(5) scroll down to bottom,
(6) You will see scroll bar reset to top when grid reload data.
See attached simple test code and grid-filter.json.zip data.
PHP Code:Ext.onReady(function() {
Ext.define('Product', {
extend: 'Ext.data.Model',
fields: [{
name: 'id',
type: 'int'
}, {
name: 'company'
}, {
name: 'price',
type: 'float'
}, {
name: 'date',
type: 'date'
}, {
name: 'visible',
type: 'boolean'
}, {
name: 'size'
}]
});
var store = Ext.create('Ext.data.JsonStore', {
model: 'Product',
proxy: {
type: 'ajax',
url: 'grid-filter.json',
reader: {
type: 'json',
root: 'data',
totalProperty:'totalCount'
}
},
remoteSort: false,
sorters: [{
property: 'company',
direction: 'ASC'
}]
});
var grid = Ext.create('Ext.grid.Panel', {
border: false,
store: store,
columns: {
defaults: { sortable: true },
items: [{
dataIndex: 'id',
header: 'Id',
flxe: 1,
}, {
dataIndex: 'company',
header: 'Company',
flxe: 1,
id: 'company'
}, {
dataIndex: 'price',
flxe: 1,
header: 'Price'
}, {
dataIndex: 'size',
flxe: 1,
header: 'Size'
}, {
dataIndex: 'date',
flxe: 1,
header: 'Date',
renderer: Ext.util.Format.dateRenderer('m/d/Y')
}, {
dataIndex: 'visible',
flxe: 1,
header: 'Visible'
}]
},
viewConfig: {
plugins: {
ptype: 'gridviewdragdrop',
dragGroup: 'DDdrop'
},
loadMask: false,
emptyText: 'No Data Found',
stripeRows: true,
preserveScrollOnRefresh: true
},
selModel:{
preventFocus: true
},
listeners: {
render: {
fn: function(){
Ext.TaskManager.start({
run: function(){
console.info( ' reload data!' );
store.load({ params: { start: 0, limit: 50 } });
},
interval: 2000
});
}
}
},
title: 'Grid Filters Example',
height: 400,
layout: 'fit'
});
var form = Ext.create('Ext.form.Panel', {
layout: 'anchor',
border: false,
defaultType: 'textfield',
bodyPadding: 5,
width: 650,
items: [{
fieldLabel: 'Company Name',
name: 'to',
anchor:'100%'
},{
fieldLabel: 'Notes',
name: 'subject',
anchor: '100%'
}, grid],
renderTo: Ext.getBody(),
});
});
-
26 Mar 2013 1:58 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
Thanks for the report! I have opened a bug in our bug tracker.
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-9262
in
4.2.1.


Reply With Quote