hph Posted August 8, 2018 Share Posted August 8, 2018 Hi Is it possible to add/remove buttons on runtime? This code works only in designtime: function beforeInit(sender, config) { config.tools = [{ type: 'gear', handler: function() { ajaxRequest(sender, "_gear", []) } }]; } Thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 8, 2018 Share Posted August 8, 2018 Hi, One possible solution (I think it's undesirable to use this code, because there may be conflicts in future versions, it's better to open a request to add this feature) Add: UniPanel1.JSInterface.JSCode(#1'.addTool({type: "gear", id: "toolGearId", handler: function() {ajaxRequest(this.toolOwner, "_gear", [])}});'); Remove: UniSession.AddJS('Ext.get("toolGearId").remove();'); Quote Link to comment Share on other sites More sharing options...
hph Posted August 9, 2018 Author Share Posted August 9, 2018 Hi DD Many thank you, it works perfect. Is it also possible to checking if the id already exitst (id: "toolGearId") ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 10, 2018 Share Posted August 10, 2018 Is it also possible to checking if the id already exitst (id: "toolGearId") ? JS Code: if (Ext.get("toolGearId")) {...} Quote Link to comment Share on other sites More sharing options...
hph Posted August 10, 2018 Author Share Posted August 10, 2018 Oh, cool! thanks you 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.