emin Posted February 25, 2022 Share Posted February 25, 2022 How can I change the expressions that appear in the dbgrid subsection according to the language chosen by the user? I found a similar thread on the forum, but I need to do this directly in code instead of clientevents. Because there are multiple language options Quote Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 25, 2022 Share Posted February 25, 2022 34 minutes ago, emin said: How can I change the expressions that appear in the dbgrid subsection according to the language chosen by the user? I found a similar thread on the forum, but I need to do this directly in code instead of clientevents. Because there are multiple language options Hello, When starting the application? Or will the "texts" also change at runtime? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 25, 2022 Share Posted February 25, 2022 These configs: beforePageText 'of {0}' afterPageText 'Page' firstText 'First Page' lastText 'Last Page' nextText 'Next Page' prevText 'Previous Page' refreshText 'Refresh' Quote Link to comment Share on other sites More sharing options...
emin Posted February 25, 2022 Author Share Posted February 25, 2022 While the form is being created, I check the language. So it is sufficient to change it at this stage. Quote Link to comment Share on other sites More sharing options...
emin Posted February 25, 2022 Author Share Posted February 25, 2022 How can I change these configs at runtime Quote These configs: beforePageText 'of {0}' afterPageText 'Page' firstText 'First Page' lastText 'Last Page' nextText 'Next Page' prevText 'Previous Page' refreshText 'Refresh' Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 25, 2022 Share Posted February 25, 2022 8 minutes ago, emin said: While the form is being created For example: procedure TMainForm.UniFormCreate(Sender: TObject); begin with UniDBGrid1 do if WebOptions.Paged then ClientEvents.UniEvents.Values['pagingBar.beforeInit'] := 'function pagingBar.beforeInit(sender, config){'+ ' config.afterPageText = "of {0}";'+ // '}' end; Quote Link to comment Share on other sites More sharing options...
emin Posted February 25, 2022 Author Share Posted February 25, 2022 Thank you Sherzod. You are perfect 1 Quote Link to comment Share on other sites More sharing options...
emin Posted February 25, 2022 Author Share Posted February 25, 2022 I need to change this part of the bar as well. But I couldn't 😒 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 25, 2022 Share Posted February 25, 2022 1 hour ago, emin said: What was it? Quote Link to comment Share on other sites More sharing options...
emin Posted February 25, 2022 Author Share Posted February 25, 2022 Total records/ Displayed records Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 25, 2022 Share Posted February 25, 2022 7 minutes ago, emin said: Total records/ Displayed records Try displayMsg config, default value: 'Displaying {0} - {1} of {2}' Quote Link to comment Share on other sites More sharing options...
emin Posted February 25, 2022 Author Share Posted February 25, 2022 I try to use like this, but doesn't work Quote with UniDBGrid2 do if WebOptions.Paged then ClientEvents.UniEvents.Values['pagingBar.beforeInit'] := 'function pagingBar.beforeInit(sender, config){'+ ' config.displayMsg = "Displaying {0} - {1} of {2}";'+ // '}'; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 25, 2022 Share Posted February 25, 2022 1 minute ago, emin said: I try to use like this, but doesn't work Perhaps you are creating a separate pagingBar. Quote Link to comment Share on other sites More sharing options...
emin Posted February 25, 2022 Author Share Posted February 25, 2022 I only add this code on create event. I didn't create another paging bar Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 25, 2022 Share Posted February 25, 2022 6 minutes ago, emin said: I only add this code on create event. I didn't create another paging bar Do you have a "text" in another language? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 25, 2022 Share Posted February 25, 2022 Also you can try this approach: Quote Link to comment Share on other sites More sharing options...
emin Posted February 25, 2022 Author Share Posted February 25, 2022 Ok. I'll try. Thank you Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 25, 2022 Share Posted February 25, 2022 Okay, let me know. Quote Link to comment Share on other sites More sharing options...
emin Posted February 25, 2022 Author Share Posted February 25, 2022 Finally I solved the problem. It was my bad. I forgot to clean clientevents. Thanks for your patience and support Quote with UniDBGrid2 do if WebOptions.Paged then ClientEvents.UniEvents.Values['pagingBar.beforeInit'] := 'function pagingBar.beforeInit(sender, config){'+ 'sender.displayInfo = true;'+ ' sender.displayMsg = sender.displayMsg = " xxxx {0} - {1} / {2} ";'+ 'config.beforePageText = "'+yyy+'";'+ '}'; 1 Quote Link to comment Share on other sites More sharing options...
ygerdel Posted September 1, 2022 Share Posted September 1, 2022 Hi, How could I capture the page number that the bar shows as I go forward / backward in the grid? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 1, 2022 Share Posted September 1, 2022 5 minutes ago, ygerdel said: How could I capture the page number that the bar shows as I go forward / backward in the grid? Hello, Please clarify your question. Quote Link to comment Share on other sites More sharing options...
ygerdel Posted September 1, 2022 Share Posted September 1, 2022 5 hours ago, Sherzod said: Hello, Please clarify your question. Hi, what I need is to get the current page number that is being displayed in the pagination bar of the grid (page 1 of 10, page 2 of 10) to use elsewhere in the system. Thank you Quote Link to comment Share on other sites More sharing options...
ygerdel Posted September 1, 2022 Share Posted September 1, 2022 17 minutes ago, ygerdel said: Hi, what I need is to get the current page number that is being displayed in the pagination bar of the grid (page 1 of 10, page 2 of 10) to use elsewhere in the system. Thank you CurrPage = UniDBGrid1.DataSource.DataSet.RecNo div UniDBGrid1.WebOptions.PageSize + 1 I found this in another post and it works perfect. Thank you. Quote Link to comment Share on other sites More sharing options...
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.