rhennink Posted May 16, 2021 Share Posted May 16, 2021 Hi, We have multiple TuniStringGrid's on one form with (for example) 40 columns. If we scroll (horizontally) in one of the grids, we would like that the other grid's are scrolling at exact the same position (horizontally). How can we do that?? RIchard Quote Link to comment Share on other sites More sharing options...
likemike Posted May 16, 2021 Share Posted May 16, 2021 Hello! Maybe this works for you: UniStringGrid1.JSInterface.JSAddListener('activate', 'function() {'+UniStringGrid1.JSName +'.getScrollable().scrollTo({x: #})}'); Replace the # with the desired scrollposition. Quote Link to comment Share on other sites More sharing options...
rhennink Posted May 16, 2021 Author Share Posted May 16, 2021 thnx. and do you know ho to get the #-value from the moving grid? Quote Link to comment Share on other sites More sharing options...
likemike Posted May 16, 2021 Share Posted May 16, 2021 No, because there is no OnScroll"-event. But in most cases Sherzod has a Java snipet for that 😉 Quote Link to comment Share on other sites More sharing options...
rhennink Posted June 27, 2022 Author Share Posted June 27, 2022 HI , The situation is that I have one view with 2 grids. Both grids have 31 days columns, with the days of the month in it. I used the UniScrollbox to scroll both grids simultaneously which worked perfectly, but 😉 Both grids have 2 fixedCols, which are als moving away when we move to the right with the UniScrollbox. (and this is off course normal behaviour) And we would like that fixed cols are always visible if we are moving the grids to the right. Any workaround how we can fix this? I Tried with the function below, but this doesn't work (in the current /latest) version. UniStringGrid1.JSInterface.JSAddListener('activate', 'function() {'+UniStringGrid1.JSName +'.getScrollable().scrollTo({x: #})}');" b Quote Link to comment Share on other sites More sharing options...
zhyhero Posted July 7, 2022 Share Posted July 7, 2022 try UniStringgrid1->clientevent->afterrender function afterrender(sender, eOpts) { sender.view.el.addListener('scroll',function(e,t){ MainForm.UniStringGrid2.view.el.dom.scrollTop=t.scrollTop; MainForm.UniStringGrid2.view.el.dom.scrollLeft=t.scrollLeft; }); } Quote Link to comment Share on other sites More sharing options...
rhennink Posted July 7, 2022 Author Share Posted July 7, 2022 Works really great!! thnx!!! 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.