Frederick Posted January 2 Author Share Posted January 2 Yes. I copied the function header as well when carrying out a a cut and paste. However, I found out what the problem is. If the TUniDBGrid's WebOptions | Paged property is False AND the datasource is empty, the code in the afterLayout event will be ignored. How can I fix this? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 2 Share Posted January 2 2 hours ago, Frederick said: However, I found out what the problem is. If the TUniDBGrid's WebOptions | Paged property is False AND the datasource is empty, the code in the afterLayout event will be ignored. How can I fix this? Try it for the whole case: procedure TMainForm.UniFormReady(Sender: TObject); begin with grdGrid do begin if (not Assigned(DataSource)) or (DataSource.DataSet.IsEmpty) or (not DataSource.DataSet.Active) then begin //JSInterface.JSCall('getStore().load', []); JSInterface.JSCall('fireEvent', ['afterlayout', JSControl]); end; end; end; Quote Link to comment Share on other sites More sharing options...
Frederick Posted January 3 Author Share Posted January 3 This works correctly in paged/non-paged and whether the datasource has data or not. Thank you. 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.