CITASys Automation Posted July 18, 2022 Share Posted July 18, 2022 Hello There's appear Ajax Error O257 is not defined when I try to open a form.. how to fixed that error ? thankyou.. Link to comment Share on other sites More sharing options...
Sherzod Posted July 18, 2022 Share Posted July 18, 2022 Hello, Not enough details... Link to comment Share on other sites More sharing options...
CITASys Automation Posted July 18, 2022 Author Share Posted July 18, 2022 UnimDBGrid1.JSInterface.JSAddListener('painted','function(me){me.setHideHeaders(true)}'); after using this code on unimform.show to remove header on dbgrid1, this ajax error appear.. Link to comment Share on other sites More sharing options...
Sherzod Posted July 18, 2022 Share Posted July 18, 2022 4 minutes ago, CITASys Automation said: JSAddListener Especially adding a handler for the painted event, you should add it to OnCreate. 6 minutes ago, CITASys Automation said: after using this code on unimform.show to remove header on dbgrid1, this ajax error appear.. Although adding in this event also works for me. Link to comment Share on other sites More sharing options...
CITASys Automation Posted July 18, 2022 Author Share Posted July 18, 2022 I already add it OnCreate before, but the ajax error O257 appear more often than I add it OnShow.. Now I try this method, and the ajax error only appears occasionally.. Do you have any idea to fixed it ? Link to comment Share on other sites More sharing options...
Sherzod Posted July 18, 2022 Share Posted July 18, 2022 15 minutes ago, CITASys Automation said: Now I try this method, and the ajax error only appears occasionally.. Are you sure that this code causes the error? Are you using any other additional codes? Link to comment Share on other sites More sharing options...
CITASys Automation Posted July 18, 2022 Author Share Posted July 18, 2022 procedure TUnimFormSenyiur.UnimFormShow(Sender: TObject); begin //UnimDBGrid1.JSInterface.JSAddListener('painted','function(me){me.setHideHeaders(true)}'); UnimDBGrid1.JSInterface.JSConfig('cls', ['customGrid']); unimpanel2.Left:=(MainmForm.Width div 2) - (unimPanel2.Width div 2); unimpanel3.Left:=(MainmForm.Width div 2) - (unimPanel3.Width div 2); unimpanel21.Left:=(MainmForm.Width div 2) - (unimPanel21.Width div 2); unimDatePicker1.Date:=now; UpdateDTP; only this code in onShow events .. Link to comment Share on other sites More sharing options...
Sherzod Posted July 18, 2022 Share Posted July 18, 2022 Ok. We'll try with defer. Link to comment Share on other sites More sharing options...
Sherzod Posted July 18, 2022 Share Posted July 18, 2022 1 hour ago, Sherzod said: Ok. We'll try with defer. 4 hours ago, CITASys Automation said: only this code in onShow events .. Try this code for test: procedure TMainmForm.UnimFormCreate(Sender: TObject); begin ... with UnimDBGrid1 do begin JSInterface.JSAddListener('painted','function(me){Ext.defer(function(){me.setHideHeaders(true)}, 500)}'); end; end; Link to comment Share on other sites More sharing options...
CITASys Automation Posted July 19, 2022 Author Share Posted July 19, 2022 the error still appear after try that code.. Link to comment Share on other sites More sharing options...
CITASys Automation Posted July 19, 2022 Author Share Posted July 19, 2022 I think the problem not at this part.. do you have idea how to trace the error based on error code ''ajax error O257''? Link to comment Share on other sites More sharing options...
Recommended Posts