PDA

View Full Version : [FIXED-723] RowEditor field editor widths



minspect
13 Mar 2010, 11:32 AM
Ext version tested:

Ext 3.0 - 3.2 beta



Browser versions tested against:

Chrome 4
FF3 (firebug 1.3.0.10 installed)


Operating System:

Win7


Description:

Field editors are 1px wider than they should be


Test Case:
Check:
http://www.extjs.com/deploy/ext-3.2-beta/examples/grid/row-editor.html
Click on the first row to open row editor. Notice the alignment of text fields comparing to column headers.

Possible fix:
In RowEditor.js find method verifyLayout: function(force) and change line
adjust += 1;
to
adjust += 2;

tobiu
15 Mar 2010, 9:14 AM
i can confirm this one (posted 12/31/09)
http://www.extjs.com/forum/showthread.php?t=88786

the row editor has other bugs as well, better test the whole ux

gridView wider than screen + showing error - tip -> flickering of error tip
when editor is a combo and you try to edit a value that is not in the store -> many firebug errors when trying to auto-fill the error-tooltip


i can provide more information if needed.


kind regards,
tobiu

hhangus
29 Mar 2010, 9:55 AM
I fixed this bug in my own project another way, by modifying the field init.




initFields: function(){
var cm = this.grid.getColumnModel(), pm = Ext.layout.ContainerLayout.prototype.parseMargins;
this.removeAll(false);
for(var i = 0, len = cm.getColumnCount(); i < len; i++){
var c = cm.getColumnAt(i),
ed = c.getEditor();
if(!ed){
ed = c.displayEditor || new Ext.form.DisplayField();
}else{
ed = ed.field;
}

////////// MODIFIED FROM v3.1.1 /////////////
/*
if(i == 0){
ed.margins = pm('0 1 2 1');
} else if(i == len - 1){
ed.margins = pm('0 0 2 1');
} else{
ed.margins = pm('0 1 2');
}
*/
ed.margins = '0 0 0 1';
ed.setWidth(cm.getColumnWidth(i));
ed.column = c;
if(ed.ownerCt !== this){
ed.on('focus', this.ensureVisible, this);
ed.on('specialkey', this.onKey, this);
}
this.insert(i, ed);
}
this.initialized = true;
},

rqmedes
7 Apr 2010, 10:10 PM
Hashing out the margins just pushes everything too far to the left.

I find setting the margins in the last branch of the else statement to
ed.margins = pm('0 1 2 0');

instead of
ed.margins = pm('0 1 2');
aligns it perfectly for me.


if (i == 0) {
ed.margins = pm('0 1 2 1');
} else if (i == len - 1) {
ed.margins = pm('0 0 2 1');
} else {
ed.margins = pm('0 1 2 0');
}

minspect
8 Apr 2010, 1:57 AM
In webkit browsers, inside RowEditor combobox trigger is shorter 2px comparing to text field.

Applies to extjs 3.1, 3.2.

Fix:
Remove line

.ext-webkit .x-small-editor .x-form-text{padding-top:3px;font-size:100%;}

from ext-all.css.

Jamie Avins
26 Apr 2010, 11:23 AM
[type]: fix
[module]: RowEditor
[id]: #723
[desc]: Fixes #723. RowEditor margins now set properly. Additional check added for different padding for IE.