Jump to content

Styling DBGrid PagingBar Button


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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...