PDA

View Full Version : Grid Cell Editing: Editor height



hiroprotagonist
18 Sep 2012, 8:03 AM
Guys,

I have a treepanel where I change the visualization with CSS. The cells are larger in height and width.
Looks like this:


.project-grid-column-default div {
margin: 1px 1px 1px 1px;
font-size: 14px;
padding: 2px 20px 8px;
}



This works nicely for the cells themselves but when using an editor for changing the cell's content, the editor's width is adapted to cell width, but not the height.

Any hints how this can be accomplished?

Many thanks

Hiro.

iplanit
18 Sep 2012, 8:45 AM
Did you try with CSS !important ?

hiroprotagonist
18 Sep 2012, 10:59 PM
The point with the CSS above is that is works perfectly for the cells, but it doesnt for the editor that is placed within the cells when trying to change the value of the cell. The editor does not fit the height that the cell gets by the padding.

So !important does not help here.
Thanks for the hint anyway.

hiroprotagonist
20 Sep 2012, 11:22 PM
guys,

the problem with the height of the editor is, that the CellEditing plugin creates a new instance of Ext.grid.CellEditor where from the outside it is not possible to add config information like the autosize information. Solution was to derive from the CellEditing plugin and override the getEditor method where I changed the code like below.

Hiro.



editor = new Ext.grid.CellEditor({
editorId: editorId,
field: editor,
ownerCt: me.grid,
/* start changing original code */
// make sure the height of the cell will be read from the cell's height.
autoSize: {
width: 'field', // Width from the field
height: 'boundEl' // Height from the boundEl
}
/* end changing original code */
});