Jump to content

Change badgetext


cdev

Recommended Posts

I have a badge made with this code:

image.thumb.png.b1760545e2c2720fab015f65ed6d5dd8.png

 

The badge of the label displays with this 'test'.

But now I want to change this badge to 'test2'.   How do I do this from within Delphi ?

Something like : uniLabel1.JSInterface.JSCall('plugins', ['test2']);

But this does not seem to work.  

Anyone can help me ?

 

Link to comment
Share on other sites

10 minutes ago, cdev said:

Something like : uniLabel1.JSInterface.JSCall('plugins', ['test2']);

No.

Try like this, for example.

On 6/10/2014 at 4:05 PM, Sherzod said:
procedure TMainForm.UniButton1Click(Sender: TObject);var
  bJSName: string;
begin
  bJSName := (Sender as TUniButton).JSName;
  UniSession.AddJS(bJSName + '.setBadgeText(' + bJSName + '.getBadgeText() + 1);');
end;

 

Link to comment
Share on other sites

14 hours ago, cdev said:

But only the background color changes to red.   Any idea to keep the color or to set back to the original color ?

Okay, I have checked. Please add enableBg: 'green' too.

function beforeInit(sender, config) 
{
    sender.action = 'badgetext';
    sender.plugins = [{
        ptype: 'badgetext',
        defaultText: 10,
        disableOpacity: 1,
        disableBg: 'green',
        align: 'right',
        enableBg: 'green'
    }];
}

 

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