Jump to content

Styling DBGrid PagingBar Button


mos

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...