Jump to content

Toolbar center grid...


thiagopedro

Recommended Posts

8 hours ago, thiagopedro said:

I am looking to automatically center the grid toolbar.

Hi,

One possible solution:

UniDBGrid1.ClientEvents.ExtEvents ->

function beforerender(sender, eOpts)
{
    var pagingBar=sender.pagingBar;
    if (pagingBar) {
        pagingBar.add(0, {xtype: 'tbfill'});
        pagingBar.add({xtype: 'tbfill'});
    }
}

 

Link to comment
Share on other sites

13 hours ago, Sherzod said:

Hi,

One possible solution:

UniDBGrid1.ClientEvents.ExtEvents ->


function beforerender(sender, eOpts)
{
    var pagingBar=sender.pagingBar;
    if (pagingBar) {
        pagingBar.add(0, {xtype: 'tbfill'});
        pagingBar.add({xtype: 'tbfill'});
    }
}

 

 

1:

it worked thank you
Could you explain what each command does? Their role.
Why css would I also get this result?

 

 

2:

Assigning in designtimer worked.
When I assemble the event at runtime through the create of the frame, it doesn't work. Any tips?

procedure TUniFrame.UniFrameCreate(Sender: TObject);
begin
  UniDBGrid.ClientEvents.UniEvents.Values['beforerender'] :=
    'function beforerender(sender, eOpts)'+
    '{'+
    'var pagingBar=sender.pagingBar;'+
    'if (pagingBar) {'+
    'pagingBar.add(0, {xtype: ''tbfill''});'+
    'pagingBar.add({xtype: ''tbfill''});'+
    '}'+
    '}';
end;

  • Like 1
Link to comment
Share on other sites

13 hours ago, thiagopedro said:

When I assemble the event at runtime through the create of the frame, it doesn't work. Any tips?

 

13 hours ago, thiagopedro said:

UniDBGrid.ClientEvents.UniEvents.Values['beforerender'] :=
    'function beforerender(sender, eOpts)'+
    '{'+
    'var pagingBar=sender.pagingBar;'+
    'if (pagingBar) {'+
    'pagingBar.add(0, {xtype: ''tbfill''});'+
    'pagingBar.add({xtype: ''tbfill''});'+
    '}'+
    '}';

Replace to ExtEvents

  • Like 1
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...