Ulugbek Posted October 12, 2013 Posted October 12, 2013 Hi All how before open dataset dbgrid scroll left? I try this but not work dataset.close gridmain.ScrollBy(-100, 0); left dataset.open; Quote
Sherzod Posted October 14, 2013 Posted October 14, 2013 Hi Ulugbek. Try this: uses ... UniGUIApplication ... UniDBGrid1.JSName+'.scrollByDeltaX(-gridScrollXValue);' UniSession.AddJS('var gridScrollXValue='+UniDBGrid1.JSName+'.getView().el.dom.scrollLeft;'+UniDBGrid1.JSName+'.scrollByDeltaX(-gridScrollXValue);'+UniDBGrid1.JSName+'.scrollByDeltaX(gridScrollXValue);'); DataSet.Close; DataSet.Open; Sincerely Quote
Ulugbek Posted October 17, 2013 Author Posted October 17, 2013 mr Duser Does not work No change scroll left Quote
Sherzod Posted October 17, 2013 Posted October 17, 2013 Hi Ulugbek. Gone was an error while rendering? Just this code returns the position of scroll in its place: UniSession.AddJS('var gridScrollXValue='+UniDBGrid1.JSName+'.getView().el.dom.scrollLeft;'+UniDBGrid1.JSName+'.scrollByDeltaX(-gridScrollXValue);'+UniDBGrid1.JSName+'.scrollByDeltaX(gridScrollXValue);');DataSet.Close;DataSet.Open; And this code returns to the starting left position: UniSession.AddJS('var gridScrollXValue='+UniDBGrid1.JSName+'.getView().el.dom.scrollLeft;'+UniDBGrid1.JSName+'.scrollByDeltaX(-gridScrollXValue);');DataSet.Close;DataSet.Open; The problem is that if you select the last column, then the code is not executed correctly, ie in the sense of running, but again, the highlight remains the selected column. Gone was an error while rendering? Sincerely. Quote
Sherzod Posted October 17, 2013 Posted October 17, 2013 OR UniSession.AddJS(UniDBGrid1.JSName+'.getView().scrollBy(-100, 0, false);'); Quote
Sherzod Posted October 18, 2013 Posted October 18, 2013 Hi Ulugbek. I know there are other solutions, but for now can use the following code: type THackGrid = class(TUniDBGrid); THackGrid(UniDBGrid1).CurrCol := 0; DataSource1.DataSet.Close; DataSource1.DataSet.Open; Sincerely ... 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.