epos4u Posted November 19, 2014 Share 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 Link to comment Share on other sites More sharing options...
Sherzod Posted November 21, 2014 Share 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 Link to comment Share on other sites More sharing options...
epos4u Posted November 21, 2014 Author Share 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 Link to comment Share on other sites More sharing options...
SISBLU Software Posted August 16, 2019 Share Posted August 16, 2019 not work! getScrollable().getScroller() is not a function Version: 1.90.0.1504 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 16, 2019 Share 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 Link to comment Share on other sites More sharing options...
epos4u Posted June 6 Author Share Posted June 6 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 Link to comment Share on other sites More sharing options...
Sherzod Posted June 6 Share Posted June 6 Hi! I will try to check. 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 8 Share Posted June 8 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 Link to comment Share on other sites More sharing options...
epos4u Posted June 8 Author Share Posted June 8 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 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.