cdev Posted April 14, 2023 Share Posted April 14, 2023 I have a badge made with this code: 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 ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 14, 2023 Share Posted April 14, 2023 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; Quote Link to comment Share on other sites More sharing options...
cdev Posted April 14, 2023 Author Share Posted April 14, 2023 Thank you Sherzod, this works fine. But only the background color changes to red. Any idea to keep the color or to set back to the original color ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 14, 2023 Share Posted April 14, 2023 58 minutes 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 ? I will try to check. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 15, 2023 Share Posted April 15, 2023 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' }]; } Quote Link to comment Share on other sites More sharing options...
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.