epos4u Posted November 19, 2014 Posted November 19, 2014 Hi, how can i scroll UnimList by code, need to have a button, once clicked it will scroll to bottom or top Many Thanks, Quote
Sherzod Posted November 21, 2014 Posted November 21, 2014 Hi, Try: procedure TMainmForm.UnimButton1Click(Sender: TObject); var ListJSName: string; begin //scrollToTop ListJSName := UnimList1.JSName; UniSession.AddJS(ListJSName + '.select(0);' + ListJSName + '.getScrollable().getScroller().scrollToTop(true);'); end; procedure TMainmForm.UnimButton2Click(Sender: TObject); var ListJSName: string; begin //scrollToEnd ListJSName := UnimList1.JSName; UniSession.AddJS(ListJSName + '.select(' + ListJSName + '.store.getCount() - 1);' + ListJSName + '.getScrollable().getScroller().scrollToEnd(true);'); end; Best regards. 1 Quote
epos4u Posted November 21, 2014 Author Posted November 21, 2014 Delphi Developer, A Big Thank you, it works, i will have to try and learn some scripting Hi, Try: procedure TMainmForm.UnimButton1Click(Sender: TObject); var ListJSName: string; begin //scrollToTop ListJSName := UnimList1.JSName; UniSession.AddJS(ListJSName + '.select(0);' + ListJSName + '.getScrollable().getScroller().scrollToTop(true);'); end; procedure TMainmForm.UnimButton2Click(Sender: TObject); var ListJSName: string; begin //scrollToEnd ListJSName := UnimList1.JSName; UniSession.AddJS(ListJSName + '.select(' + ListJSName + '.store.getCount() - 1);' + ListJSName + '.getScrollable().getScroller().scrollToEnd(true);'); end; Best regards. Quote
SISBLU Software Posted August 16, 2019 Posted August 16, 2019 not work! getScrollable().getScroller() is not a function Version: 1.90.0.1504 Quote
Sherzod Posted August 16, 2019 Posted August 16, 2019 1 hour ago, Daha Software said: not work! getScrollable().getScroller() is not a function Version: 1.90.0.1504 We will check. Quote
epos4u Posted June 6, 2024 Author Posted June 6, 2024 Hi Brother Sherzod, Have you got a solution for UniListBox , how can i scroll Listbox by code, need to have a button, once clicked it will scroll to bottom thank you , the initial works for moble listbox not standard UniListBox Quote
Sherzod Posted June 8, 2024 Posted June 8, 2024 On 6/6/2024 at 7:24 PM, epos4u said: Have you got a solution for UniListBox Hi! Try this approach, the third parameter is the animation parameter: procedure TMainForm.UniButton1Click(Sender: TObject); begin with UniListBox1.JSInterface do JSCall('boundList.getScrollable().scrollBy', [JSStatement('0, Infinity, true')]); end; 1 Quote
epos4u Posted June 8, 2024 Author Posted June 8, 2024 5 hours ago, Sherzod said: Hi! Try this approach, the third parameter is the animation parameter: procedure TMainForm.UniButton1Click(Sender: TObject); begin with UniListBox1.JSInterface do JSCall('boundList.getScrollable().scrollBy', [JSStatement('0, Infinity, true')]); end; Thank you brother, it works perfect 1 Quote
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.