PDA

View Full Version : Row editor is not resized properly



lfs2008
5 Jun 2013, 7:26 AM
Hi all!

i am having a problem with Row editor resizing - initial widths presevred while grid columns configured as flexible.

Initial state of grid - click editor - ok

44215

close editor.
do column resize -> click editor -> width not resized

44216

close editor.
do window resize -> click editor -> second field not visible

44217

Grid config



Ext.define('Common.view.te.DataType.Panel', {
extend:'Ext.grid.Panel',
alias:'widget.dtGrid',
title:'Data Types List',
store:'Common.store.te.DataType',
autoHeight:true,
autoScroll:true,
header:false,
tbar:
{
items:[
{
text:'New',
action:'create',
id:'app-id-createdt-btn',
xtype:'button',
}
]
},
defaults:{
width:75,
flex:1


},

viewConfig:{
stripeRows:true,
toggleOnDblClick:false
},


plugins:[


Ext.create('Ext.ux.grid.RowEditing', {

afterEdit : function(me){

Ext.getCmp('app-id-createdt-btn').enable();
var grid = Ext.ComponentQuery.query('dtGrid')[0];
var store = grid.getStore();


if (store.getAt(0) && !store.getAt(0).get('id')){
store.rejectChanges();
}


},
clicksToMoveEditor:1,
clicksToEdit:1,
errorSummary:false,
autoCancel:true
})


],
autoExpandColumn:'name',
columns:[


{header:'Name',
id:'dtname',
dataIndex:'name',
renderer: 'htmlEncode',
hideable: false,
flex:3,
editor:{
allowBlank:false
}
},
{
header:'Decay Period (days)',
flex:1,
xtype:'gridcolumn',
align:'left',
hideable: false,
editor:{
allowBlank: true,
allowDecimals: false,
xtype:'numberfield',
minValue:1,
maxValue: 365
},
dataIndex:'decayPeriod'
}

]
});




what is the best approach to deal with it?

tobiu
5 Jun 2013, 7:53 AM
Which version of our framework are you using?

Best regards
tobiu

lfs2008
5 Jun 2013, 9:18 AM
ext-4.1.1/ext-all-debug.js

tobiu
5 Jun 2013, 11:11 AM
I tested this with 4.1.3 and 4.2.1 and for both it seems to work fine.

http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/grid/row-editing.html

http://docs.sencha.com/extjs/4.1.3/extjs-build/examples/grid/row-editing.html

Just replace width with flex for the columns and add resizable: true to the grid panel if you like to.

Best regards
tobiu