andyhill Posted October 16, 2017 Share Posted October 16, 2017 I have a uniDBListGrid and UnimLabel that I want to refresh (update) via a unimTimer - please advise in Delphi code - thanks. procedure TUniMainModule.UnimTimer1Timer(Sender: TObject); begin UniMainModule.MyQuery.Refresh; // Data is modified externally UniSession.AddJS(MainmForm.UnimDBListGrid1.JSName + '.view.refresh();'); IF DataPanelmForm is Showing (shown via Disclosure) then update etc. DataPanelmForm.lblServicedCalls.Text:= 'ServicedCalls: '+IntToStr(UniMainModule.DataSource1.DataSet.FieldByName('ServicedCalls').AsInteger); UniSession.AddJS(DataPanelmForm.lblServicedCalls.JSName + '.refresh();'); END UniSession.Synchronize; Link to comment Share on other sites More sharing options...
Sherzod Posted October 16, 2017 Share Posted October 16, 2017 Hi, Can you explain your question a little more ?: procedure TMainmForm.UnimTimer1Timer(Sender: TObject); begin UnimLabel1.Caption := 'Last updated: ' + FormatDateTime('dd.mm.yyyy hh:mm:ss', Now); end; ? Best regards, Link to comment Share on other sites More sharing options...
andyhill Posted October 16, 2017 Author Share Posted October 16, 2017 What about uniDBListGrid ? My code above does not refresh ? Link to comment Share on other sites More sharing options...
Sherzod Posted October 16, 2017 Share Posted October 16, 2017 Hi, What about uniDBListGrid ? My code above does not refresh ? Please make a testcase. Link to comment Share on other sites More sharing options...
andyhill Posted October 16, 2017 Author Share Posted October 16, 2017 OK, Trial and Error has shown me that uniTimers/unimTimers only work on the form on which they are placed ! I had my timer on the MainModule (so as to reduce resources) and called it from other forms - does not work for me as stated above. Also, the advise I had been given earlier (UniSession.AddJS(MainmForm.UnimDBListGrid1.JSName + '.view.refresh();') failed because there is no View property. I have dropped the "view" qualifier. Now working. Posted for the benefit of others that follow. Link to comment Share on other sites More sharing options...
Recommended Posts