Freeman35 Posted February 8, 2019 Share Posted February 8, 2019 Hello, How can I handle when "TUniToolButton.Enable" changed in runtime? Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted February 8, 2019 Share Posted February 8, 2019 Hi, You mean if we execute "button.setEnabled(false)" in clientside i want to able to know it? Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted February 8, 2019 Author Share Posted February 8, 2019 32 minutes ago, Hayri ASLAN said: Hi, You mean if we execute "button.setEnabled(false)" in clientside i want to able to know it? I mean, I need handle this property changing, because, I wanna "add / remove" css, so make a disable efect. If I handle this property after changing, I can add this code. Other wise, I have to add more line after each xxx.Enable:= True; or False; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 8, 2019 Share Posted February 8, 2019 Hi, One possible solution by using ClientEvents UniToolBar -> ClientEvents -> UniEvents function beforeInit(sender, config) { config.defaults = { listeners: { enable: function(sender, eOpts) { // }, disable: function(sender, eOpts) { // } } } } Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted February 8, 2019 Author Share Posted February 8, 2019 function beforeInit(sender, config) { config.defaults = { listeners: { enable: function(sender, eOpts) { ajaxRequest(sender, '_enable',[]); }, disable: function(sender, eOpts) { ajaxRequest(sender, '_disable'',[]); } } } } Is any wrong type or which component's onAjaxEvent? I mean form's.OnAjaxEvent or ToolButton's.OnAjaxEvent Thank you Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted February 8, 2019 Author Share Posted February 8, 2019 function beforeInit(sender, config) { config.defaults = { listeners: { enable: function(sender, eOpts) { sender.removeClass('disabled'); }, disable: function(sender, eOpts) { sender.addClass('disabled'); } } } } This is much better translate what I want for TUniToolButton regards Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 8, 2019 Share Posted February 8, 2019 1 minute ago, Freeman35 said: This is much better translate what I want for TUniToolButton Yes... 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.