PDA

View Full Version : Textfield error position



mkaw
13 Jun 2012, 4:32 AM
I have gridpanel with row editor like this :
36198
Code:

columns: [ {
xtype: 'gridcolumn',
dataIndex: 'name',
text: 'Nazwa',
flex: 1,
editor: {
xtype: 'textfield',
allowBlank: false
}
}
How to set position of Errors tooltip? Grid is fitted in maximized window.

scottmartin
13 Jun 2012, 7:19 AM
You can use the following as a reference. You may need to make adjustments as needed.



// move the tip below the editor
Ext.override(Ext.grid.RowEditor, {
showToolTip: function(msg) {
var me = this,
tip = me.getToolTip(),
context = me.context,
row = Ext.get(context.row),
viewEl = context.grid.view.el;

tip.setTarget(row);
tip.showAt([-10000, -10000]);
tip.body.update(me.getErrors());
tip.mouseOffset = [viewEl.getWidth() - row.getWidth() + me.lastScrollLeft + 15, 24]; // 0; now 24
me.repositionTip();
tip.doLayout();
tip.enable(); }
});


Regards,
Scott.

mkaw
13 Jun 2012, 11:17 PM
Thank you. It was really helpful.