AlexanderP Posted July 21, 2025 Posted July 21, 2025 Добрый день! Я использую этот код для отображения кнопки и вывода в подсказку содержимое поля Все работает, но не могу подсказку расположить слева от кнопки, всегда выводится справа, хотя указал так sender.tip.showBy(btn, 'br-tr?', [0, 0]); Что я делаю не так ? function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { columns[2].renderer = function(value, metadata, record) { var buttonId = Ext.id('btn-'); Ext.defer(function() { var btn = Ext.get(buttonId); if(btn) { btn.on('click', function(e) { e.stopEvent(); if(sender.tip) { sender.tip.destroy(); } sender.tip = new Ext.tip.ToolTip( { target: btn, html: Ext.util.Format.htmlEncode(record.get('1')), width: 300, autoHide: false, closable: true, bodyStyle: 'user-select: text; padding: 10px; background-color:white;', draggable: { delegate: 'h1' }, resizable: { dynamic: true, handles: 's e se' }, listeners: { destroy: function() { btn.tip = null; } } }); sender.tip.showBy(btn, 'br-tr?', [0, 0]); }); } }, 50); return '<div style="display:flex;">' + '<div style="flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding-right:8px;">' + value + '</div>' + '<button id="' + buttonId + '" ' + 'style="flex-shrink:0; background:#4CAF50; color:white; border:none; border-radius:4px; padding:2px 8px; cursor:pointer; width:12px; height:12px;">' + '</button>' + '</div>'; }; } всегда выводится так а хочу чтобы было так Quote
Sherzod Posted July 21, 2025 Posted July 21, 2025 Добрый день! Попробуйте defaultAlign конфиг: ... sender.tip = new Ext.tip.ToolTip( { defaultAlign: 'br-tl', target: btn, ... Quote
AlexanderP Posted July 21, 2025 Author Posted July 21, 2025 1 hour ago, Sherzod said: Добрый день! Попробуйте defaultAlign конфиг: ... sender.tip = new Ext.tip.ToolTip( { defaultAlign: 'br-tl', target: btn, ... Так работает, Спасибо! Quote
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.