thiagopedro 2 Posted March 2, 2020 Share Posted March 2, 2020 I am looking to automatically center the grid toolbar. Quote Link to post Share on other sites
Sherzod 1133 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'}); } } Quote Link to post Share on other sites
thiagopedro 2 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 Quote Link to post Share on other sites
Sherzod 1133 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 Quote Link to post Share on other sites
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.