artem_niko Posted March 31, 2020 Share Posted March 31, 2020 Hello! I'm trying set ToolTip RunTime to UniComboBox and I get error: This is full text of error: Quote _rsov_(O5D4,2);O5D4.setTooltip("\x3Cb\x3EИнформация о выбранной технологической карте:\x3C/b\x3E\x3Cbr\x3E\x3Cb\x3E\x3Cfont color=\"blue\"\x3EИТОГО:\x3C/font\x3E\x3C/b\x3E\x3Cbr\x3EБ: \x3Cb\x3E10,8\x3C/b\x3E\x3Cbr\x3EЖ: \x3Cb\x3E11,4\x3C/b\x3E\x3Cbr\x3EУ: \x3Cb\x3E75,3\x3C/b\x3E\x3Cbr\x3EЭЦ: \x3Cb\x3E445\x3C/b\x3E\x3Cbr\x3E\x3Cb\x3E\x3Cfont color=\"blue\"\x3EВитамины и минеральные вещества:\x3C/font\x3E\x3C/b\x3E\x3Cbr\x3EB\x3Csmall\x3E1\x3C/small\x3E: \x3Cb\x3E0,42\x3C/b\x3E\x3Cbr\x3EC: \x3Cb\x3E33\x3C/b\x3E\x3Cbr\x3EA: \x3Cb\x3E0\x3C/b\x3E\x3Cbr\x3EE: \x3Cb\x3E5,5\x3C/b\x3E\x3Cbr\x3ECa: \x3Cb\x3E61\x3C/b\x3E\x3Cbr\x3EP: \x3Cb\x3E254\x3C/b\x3E\x3Cbr\x3EMg: \x3Cb\x3E96\x3C/b\x3E\x3Cbr\x3EFe: \x3Cb\x3E3,8\x3C/b\x3E"); And this is code creating ToolTip: UniComboBoxTechnologicalMaps.JSInterface.JSCall('setTooltip',['<b>Информация о выбранной технологической карте:</b><br><b><font color="blue">ИТОГО:</font></b><br>' + 'Б: <b>' + FloatToStr(UniMainModule.SumSquirrels) + '</b><br>' + 'Ж: <b>' + FloatToStr(UniMainModule.SumFats) + '</b><br>' + 'У: <b>' + FloatToStr(UniMainModule.SumCarbohydrates) + '</b><br>' + 'ЭЦ: <b>' + FloatToStr(UniMainModule.SumEnergy) + '</b><br>' + '<b><font color="blue">Витамины и минеральные вещества:</font></b><br>' + 'B<small>1</small>: <b>' + FloatToStr(UniMainModule.TotalB1) + '</b><br>' + 'C: <b>' + FloatToStr(UniMainModule.TotalC) + '</b><br>' + 'A: <b>' + FloatToStr(UniMainModule.TotalA) + '</b><br>' + 'E: <b>' + FloatToStr(UniMainModule.TotalE) + '</b><br>' + 'Ca: <b>' + FloatToStr(UniMainModule.TotalCa) + '</b><br>' + 'P: <b>' + FloatToStr(UniMainModule.TotalP) + '</b><br>' + 'Mg: <b>' + FloatToStr(UniMainModule.TotalMg) + '</b><br>' + 'Fe: <b>' + FloatToStr(UniMainModule.TotalFe) + '</b>']); Link to comment Share on other sites More sharing options...
Sherzod Posted March 31, 2020 Share Posted March 31, 2020 1 hour ago, Артем said: I'm trying set ToolTip RunTime to UniComboBox and I get error: Hello, Perhaps this approach will suit you: function afterrender(sender, eOpts) { Ext.QuickTips.register({ target: sender.getEl(), text: 'toolTip text...' }); } Link to comment Share on other sites More sharing options...
artem_niko Posted March 31, 2020 Author Share Posted March 31, 2020 14 minutes ago, Sherzod said: Hello, Perhaps this approach will suit you: function afterrender(sender, eOpts) { Ext.QuickTips.register({ target: sender.getEl(), text: 'toolTip text...' }); } Hm.... What I must write in? 'toolTip text...' I must write this in RunTime? Link to comment Share on other sites More sharing options...
Sherzod Posted March 31, 2020 Share Posted March 31, 2020 5 minutes ago, Артем said: function afterrender(sender, eOpts) { Ext.QuickTips.register({ target: sender.getEl(), text: 'toolTip text...' }); } Did you try to check it? This will show the hint with the text: 'toolTip text...' Link to comment Share on other sites More sharing options...
artem_niko Posted March 31, 2020 Author Share Posted March 31, 2020 6 minutes ago, Sherzod said: Did you try to check it? This will show the hint with the text: 'toolTip text...' Yes, this work, isf use JavaScript: Link to comment Share on other sites More sharing options...
Sherzod Posted March 31, 2020 Share Posted March 31, 2020 14 minutes ago, Sherzod said: This will show the hint with the text: 'toolTip text...' Is the above solution enough for you? 1 Link to comment Share on other sites More sharing options...
artem_niko Posted March 31, 2020 Author Share Posted March 31, 2020 1 minute ago, Sherzod said: Is the above solution enough for you? I think, how I write this in RunTime? I need put my text in ToolTip. Link to comment Share on other sites More sharing options...
Sherzod Posted March 31, 2020 Share Posted March 31, 2020 3 minutes ago, Артем said: I think, how I write this in RunTime? I need put my text in ToolTip. 1. function afterrender(sender, eOpts) { Ext.QuickTips.register({ target: sender.getEl(), text: sender.toolTipText }); } 2. procedure TMainForm.UniFormCreate(Sender: TObject); begin UniComboBox1.JSInterface.JSAssign('toolTipText', ['Your custom<br>toolTip...']); end; 1 Link to comment Share on other sites More sharing options...
MOGSY Posted April 2, 2020 Share Posted April 2, 2020 Hi What changes needed to make the above to work for TUniStringGrid? Regards Link to comment Share on other sites More sharing options...
Sherzod Posted April 2, 2020 Share Posted April 2, 2020 5 minutes ago, MOGSY said: What changes needed to make the above to work for TUniStringGrid? Check this solution, at least with a simple test case. For some reason you had problems as you said earlier. Link to comment Share on other sites More sharing options...
MOGSY Posted April 2, 2020 Share Posted April 2, 2020 Hi Sherzod Unfortunatly that solution crashes the system, I did send a simple test case which showed what happens and nothing is shown on the consol. this code works for the stringgrid, however I have not been able to change the text on dynamically. regards function afterrender(sender, eOpts) { Ext.QuickTips.register({ target: sender.getEl(), text: 'toolTip text...' }); } Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now