PDA

View Full Version : Grid and Celleditor: How to change height?



mice-pace
16 Apr 2013, 9:58 PM
While editing a grid, i used a custom template to display some more information about the trade, which expanded the row size... This actually looks much better than the tiny lines it was using before, but doesn't play well with mutli-lined description text, and plays merry havoc with the editor, which not only no longer appears at the time height as the content, but doesn't utilise the height either.

Here's what it looks like:

43172

If i could, i'd like to be able to have the editor appear in the center, and for the textarea on description, have it take up the whole height if possible

slemmon
18 Apr 2013, 11:58 AM
You might set a listener on the grid to listen to the beforeedit event and style the editorfields as appropriate. Something like below. That sets the field height - would have to do margins or the like I'd think for textfields you wanted centered.



listeners: {
beforeedit: function (editor, e) {
var editorField = e.column.getEditor();
if (editorField.isXType('textarea')) {
editorField.setHeight(Ext.fly(e.row).getHeight());
}
}
}