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 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();'); 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") ? 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")) {...} 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now