andyhill Posted July 19, 2023 Share Posted July 19, 2023 procedure TfMain.ListGridAfterLoad(Sender: TUniCustomDBGrid); var DBGridJSName: string; _RecNo: Integer; begin ListGrid.SetFocus; if ListGrid.DataSource.DataSet.RecordCount > 0 then begin ListGrid.DataSource.DataSet.First; DBGridJSName:= ListGrid.JSName; _RecNo:= 1; UniSession.AddJS(DBGridJSName + '.getSelectionModel().select('+ DBGridJSName +'.getStore().data.indexOfKey('+ IntToStr(_RecNo) +'), true)'); end; end; Please advise how to do this for TUnimDBListGrid - thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 19, 2023 Share Posted July 19, 2023 Hello, This post may help you: Quote Link to comment Share on other sites More sharing options...
andyhill Posted July 19, 2023 Author Share Posted July 19, 2023 Not scroll, SELECT Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 19, 2023 Share Posted July 19, 2023 8 minutes ago, andyhill said: Not scroll, SELECT Okay. Have you even analyzed the above code? Quote Link to comment Share on other sites More sharing options...
andyhill Posted July 19, 2023 Author Share Posted July 19, 2023 Gotit with ListGrid do begin JSInterface.JSCode('Ext.defer(function(){'#1'.select('+IntToStr(UniMainModule.ID)+')}, 150);'); end; 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.