mos Posted October 7, 2020 Share Posted October 7, 2020 I have created a pagingbar button using the following code: function pagingBar.boxready(sender, width, height, eOpts) { this.add([ '-', { xtype: "button", text: 'More Records', width: 100, id: "moreRecsBtn", listeners: { click: function() { ajaxRequest(sender, "_moreRecs", []); } } } ]); } In the OnAjaxEvent of the DBGrid I have the following code which is suppose to change the text color of the button when it's clicked but it doesn't: if EventName = '_moreRecs' then UniSession.AddJS('Ext.getCmp("moreRecsBtn").setStyle(' + '''' + 'color' + '''' + ',' + '''' + 'red' + '''' + ');'); How can I change the text color of the button? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 7, 2020 Share Posted October 7, 2020 8 hours ago, mos said: Ext.getCmp("moreRecsBtn") Hello, Try using this instead: Ext.select("#moreRecsBtn .x-btn-inner") Quote Link to comment Share on other sites More sharing options...
mos Posted October 8, 2020 Author Share Posted October 8, 2020 Hi Sherzod, Thanks that worked. However I have found an issue which I have attached a project which illustrates the problem. In the example I have a PageControl which has two DBGrids which both have the More Records custom button. The issue is when I click on the UniTabSheet2 tab cross icon to close the tab sheet the More Records button disappears in the UniTabSheet1 DBGrid. Example.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 8, 2020 Share Posted October 8, 2020 6 hours ago, mos said: The issue is when I click on the UniTabSheet2 tab cross icon to close the tab sheet the More Records button disappears in the UniTabSheet1 DBGrid. Hi, First of all, you can solve the problem by assigning different IDs. 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.