Sherzod Posted June 10, 2014 Share Posted June 10, 2014 Hi All! Ext.ux.plugin.BadgeText How to use? 1. Download the file BadgeText.js from here: https://github.com/Certun/Ext.ux.plugin.BadgeText/blob/master/BadgeText.js and copy to the directory /files/ 2. Add CustomFiles in UniServerModule: files/BadgeText.js 3. UniButton1 -> ClientEvents -> UniEvents add beforeInit function function beforeInit(sender) { sender.action = 'badgetext'; sender.plugins = [ { ptype:'badgetext', defaultText: 10, disableOpacity:1, disableBg: 'green', align:'right' } ]; } Use For example: procedure TMainForm.UniButton1Click(Sender: TObject);var bJSName: string; begin bJSName := (Sender as TUniButton).JSName; UniSession.AddJS(bJSName + '.setBadgeText(' + bJSName + '.getBadgeText() + 1);'); end; source: https://github.com/Certun/Ext.ux.plugin.BadgeText demos and more config: https://fiddle.sencha.com/#fiddle/4dc is another similar plugin... https://fiddle.sencha.com/#fiddle/2ar Best regards. 4 Quote Link to comment Share on other sites More sharing options...
ganzqgy Posted June 10, 2014 Share Posted June 10, 2014 good! Quote Link to comment Share on other sites More sharing options...
ganzqgy Posted June 10, 2014 Share Posted June 10, 2014 Cannot read property 'init' of null Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 10, 2014 Author Share Posted June 10, 2014 Cannot read property 'init' of null Please what the problem is, I do not understand. Quote Link to comment Share on other sites More sharing options...
ganzqgy Posted June 10, 2014 Share Posted June 10, 2014 Don't work。 Can you create a DEMO? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 10, 2014 Author Share Posted June 10, 2014 Don't work。 Can you create a DEMO? I attached the file, try ... badgeText.zip 1 Quote Link to comment Share on other sites More sharing options...
ganzqgy Posted June 10, 2014 Share Posted June 10, 2014 I do so, still can not successfully. Quote Link to comment Share on other sites More sharing options...
ganzqgy Posted June 10, 2014 Share Posted June 10, 2014 Successful, thank you, because you are not the same as the JS file. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 10, 2014 Author Share Posted June 10, 2014 Successful, thank you, because you are not the same as the JS file. https://raw.githubusercontent.com/Certun/Ext.ux.plugin.BadgeText/master/BadgeText.js Quote Link to comment Share on other sites More sharing options...
ganzqgy Posted June 10, 2014 Share Posted June 10, 2014 Thank you, this useful. Quote Link to comment Share on other sites More sharing options...
mehmet07 Posted June 29, 2014 Share Posted June 29, 2014 hi, how change badget color ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 29, 2014 Author Share Posted June 29, 2014 Hi! If in runtime, try 1. Change TextColor: UniSession.AddJS(UniButton1.JSName + '.badgeEl.setStyle(''color'', ''red'');'); 2. Change BackgroundColor: UniSession.AddJS(UniButton1.JSName + '.badgeEl.setStyle(''background-color'', ''red'');'); Best regards. 1 Quote Link to comment Share on other sites More sharing options...
mehmet07 Posted June 30, 2014 Share Posted June 30, 2014 Thank you Quote Link to comment Share on other sites More sharing options...
stone feng Posted July 3, 2014 Share Posted July 3, 2014 Good! Quote Link to comment Share on other sites More sharing options...
chefdackel Posted January 5, 2015 Share Posted January 5, 2015 I attached the file, try ... badgeText.zip thank you very much. As the badgetext is created for buttons, its not so easy to adapt it to TabControls or Pagecontrols, such as here (see image down)? I could not make that work, but that would be another great field for badgetext: brfc Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 5, 2015 Author Share Posted January 5, 2015 Hi chefdackel ! I will try.. Best regards. 1 Quote Link to comment Share on other sites More sharing options...
billyChou Posted January 5, 2015 Share Posted January 5, 2015 Thanks Quote Link to comment Share on other sites More sharing options...
chefdackel Posted January 5, 2015 Share Posted January 5, 2015 Hi chefdackel ! I will try.. Best regards. great, for UniGUI it may look like this, here for the TabControl (thanks to Photoshop), more usable for most of us would be a PageControl? ...there is few space for the badgetext. With UniTabControl and UniPageControl, even when putting some blanks at the end of the caption for a tab, the caption is trimmed from the blanks. Maybe there will be a need to change the caption of tabs in runtime, so f.e. "Tab1" if there is no value for the badgetext (and the badgetext is not shown at all), and f.e. "Tab1..." if there is a value for the badgetext. Only an idea. brfc Quote Link to comment Share on other sites More sharing options...
chefdackel Posted January 23, 2015 Share Posted January 23, 2015 How to set visibility of the badgetext by code? Explanation: I want to show the recordcount of a db table with the badgetext. As long as the recordcount is "0" I don`t want to show the badgetext, if the recordcount is not "0" I want to show the badgetext (by code): if dbtable.recordcount =0 then [badgetext.visible=false] else [badgetext.visible=true] brfc Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 23, 2015 Author Share Posted January 23, 2015 Hi chefdackel !Example, UniButton1 with badgeText:Hide: // if .... UniSession.AddJS(UniButton1.JSName + '.badgeEl.hide();'); Show: // if .... UniSession.AddJS(UniButton1.JSName + '.badgeEl.show();'); Try...Best regards. 2 Quote Link to comment Share on other sites More sharing options...
Sistema Fenix Posted November 23, 2015 Share Posted November 23, 2015 Thank you! Quote Link to comment Share on other sites More sharing options...
estrify Posted December 23, 2015 Share Posted December 23, 2015 Hi Delphi Developer, Thanks for this plugin, is very, very useful ... Sorry for the daring but how can you associate with a UniTabSheet a UniPageControl instead of a button ??... and with a UniMenuItem??? Thank you in advance... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 23, 2015 Author Share Posted December 23, 2015 Hi Delphi Developer, Thanks for this plugin, is very, very useful ... Sorry for the daring but how can you associate with a UniTabSheet a UniPageControl instead of a button ??... and with a UniMenuItem??? Thank you in advance... thank you very much. As the badgetext is created for buttons, its not so easy to adapt it to TabControls or Pagecontrols, such as here (see image down)? I could not make that work, but that would be another great field for badgetext: Unbenannt-1.jpg brfc Hi chefdackel ! I will try.. Best regards. Hi! Yes, I'm sorry, I promised that I will try to implement it, but there were some problems ... Once again, I will try, if possible, I will let you know Best regards. Quote Link to comment Share on other sites More sharing options...
marquesrb Posted January 5, 2016 Share Posted January 5, 2016 Hi Delphi Developer, Pretty nice plugin, thank you. 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 5, 2016 Author Share Posted January 5, 2016 Hi Renato! Thank you.. Best regards. 1 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.