55143681 Posted September 11, 2018 Share Posted September 11, 2018 I have a dbGrid,and some field is too long,so when I select one row ,I want to see all the context,and want to display a window to show the context,can you help me? Quote Link to comment Share on other sites More sharing options...
belo Posted September 11, 2018 Share Posted September 11, 2018 maybe this will help.. http://forums.unigui.com/index.php?/topic/6712-overflowing-text-grid-cell-tooltip/&do=findComment&comment=34164 UniDBGrid -> ClientEvents -> ExtEvents viewready fn function viewready(sender, eOpts) { var tm = new Ext.util.TextMetrics(); sender.view.tip = Ext.create('Ext.tip.ToolTip', { target: sender.view.el, delegate: sender.view.cellSelector, trackMouse: true, renderTo: Ext.getBody(), listeners: { beforeshow: function updateTipBody(tip) { gridColums = sender.view.getGridColumns(); column = gridColums[tip.triggerElement.cellIndex]; record = sender.view.getRecord(tip.triggerElement.parentNode); if (column.dataIndex !== '-1' && (column.getWidth() < (tm.getSize(record.data[parseInt(column.dataIndex)]).width) + 5)) { tip.update(record.data[parseInt(column.dataIndex)]); } else { return false; } } } }); } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 11, 2018 Share Posted September 11, 2018 Or simple try to use Columns[xx] -> ShowToolTip = True Quote Link to comment Share on other sites More sharing options...
55143681 Posted September 11, 2018 Author Share Posted September 11, 2018 7 hours ago, Sherzod said: Or simple try to use Columns[xx] -> ShowToolTip = True Ha ha,easy to use and works well. And another property ShowToolTipAlways mean what? Quote Link to comment Share on other sites More sharing options...
55143681 Posted September 11, 2018 Author Share Posted September 11, 2018 9 hours ago, belo said: maybe this will help.. http://forums.unigui.com/index.php?/topic/6712-overflowing-text-grid-cell-tooltip/&do=findComment&comment=34164 UniDBGrid -> ClientEvents -> ExtEvents viewready fn function viewready(sender, eOpts) { var tm = new Ext.util.TextMetrics(); sender.view.tip = Ext.create('Ext.tip.ToolTip', { target: sender.view.el, delegate: sender.view.cellSelector, trackMouse: true, renderTo: Ext.getBody(), listeners: { beforeshow: function updateTipBody(tip) { gridColums = sender.view.getGridColumns(); column = gridColums[tip.triggerElement.cellIndex]; record = sender.view.getRecord(tip.triggerElement.parentNode); if (column.dataIndex !== '-1' && (column.getWidth() < (tm.getSize(record.data[parseInt(column.dataIndex)]).width) + 5)) { tip.update(record.data[parseInt(column.dataIndex)]); } else { return false; } } } }); } Thanks a lot,I have a new method. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.