Jump to content

How to have a tip at the point you click?


55143681

Recommended Posts

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;
                }
            }
        }
    });
}

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...