GoldLine Posted December 10, 2020 Share Posted December 10, 2020 Hello, is it possible to access delphi class properties from javascript (unievents/extevents)? I want to read the value of unimpanel.enabled in javascript function. Thanks Link to comment Share on other sites More sharing options...
Sherzod Posted December 10, 2020 Share Posted December 10, 2020 7 minutes ago, GoldLine said: in javascript function Hello, Please explain. Link to comment Share on other sites More sharing options...
GoldLine Posted December 10, 2020 Author Share Posted December 10, 2020 Hello Sherzod, f.e. function beforeInit(sender, config) { config.listeners= { click: { element: 'el', fn: function(e,el){ if (MainmForm.pnlOrder.Enabled==true) { <== something like that TweenLite.fromTo($('#'+el.id), 0.2,{backgroundColor :'#ffffff'},{backgroundColor :'#d2d2d2',onComplete:function(){ TweenLite.to($('#'+el.id), 1.0,{backgroundColor :'#ffffff'}) } } }); } } }; } Link to comment Share on other sites More sharing options...
Sherzod Posted December 10, 2020 Share Posted December 10, 2020 29 minutes ago, GoldLine said: function beforeInit(sender, config) For which component are you using this event? Link to comment Share on other sites More sharing options...
GoldLine Posted December 10, 2020 Author Share Posted December 10, 2020 I use this function event in TUnimPanel -> UniEvents Link to comment Share on other sites More sharing options...
Sherzod Posted December 10, 2020 Share Posted December 10, 2020 8 minutes ago, GoldLine said: TUnimPanel pnlOrder? Link to comment Share on other sites More sharing options...
GoldLine Posted December 10, 2020 Author Share Posted December 10, 2020 Yes. Link to comment Share on other sites More sharing options...
Sherzod Posted December 10, 2020 Share Posted December 10, 2020 1 hour ago, GoldLine said: if (MainmForm.pnlOrder.Enabled==true) { Try this: if (sender.isEnabled()) { } Link to comment Share on other sites More sharing options...
GoldLine Posted December 10, 2020 Author Share Posted December 10, 2020 Works perfect!!! Thank you. And in case where pnlOrder isn't TUnimPanel (..is another panel on MainmForm), is there also a solution? Link to comment Share on other sites More sharing options...
Sherzod Posted December 10, 2020 Share Posted December 10, 2020 1 minute ago, GoldLine said: And in case where pnlOrder isn't TUnimPanel (..is another panel on MainmForm), is there also a solution? if (MainmForm.pnlOrder.isEnabled() ==true) Link to comment Share on other sites More sharing options...
GoldLine Posted December 10, 2020 Author Share Posted December 10, 2020 👍🙏 1 Link to comment Share on other sites More sharing options...
Recommended Posts