Jump to content

Error in UniComboBox using ToolTip


artem_niko

Recommended Posts

Hello!

I'm trying set ToolTip RunTime to UniComboBox and I get error:

image.png.4308c47ee98e8a64cbe2126b71c5ccfb.png

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

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

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

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;

 

  • Like 1
Link to comment
Share on other sites

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

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...