thiagopedro Posted March 2, 2020 Share Posted March 2, 2020 I am looking to automatically center the grid toolbar. Link to comment Share on other sites More sharing options...
Sherzod Posted March 3, 2020 Share Posted March 3, 2020 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 More sharing options...
thiagopedro Posted March 3, 2020 Author Share Posted March 3, 2020 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; 1 Link to comment Share on other sites More sharing options...
picyka Posted March 3, 2020 Share Posted March 3, 2020 +1 Link to comment Share on other sites More sharing options...
Sherzod Posted March 4, 2020 Share Posted March 4, 2020 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 1 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