ariopax Posted June 25, 2016 Share Posted June 25, 2016 Hi I have UniDateTimePicker that created in runtime.How to add below code? function beforeInit(sender, config) { sender.plugins = [new Ext.ux.JalaliDatePlugin] } Best Regards. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 25, 2016 Share Posted June 25, 2016 Hi, YourComponent.ClientEvents.UniEvents.Values['beforeInit'] := 'function (sender, config) {sender.plugins = [new Ext.ux.JalaliDatePlugin]}'); Best regards. 1 Quote Link to comment Share on other sites More sharing options...
ariopax Posted June 25, 2016 Author Share Posted June 25, 2016 Hi Delphi Developer Thanks,It's worked! Best Regards. Quote Link to comment Share on other sites More sharing options...
ariopax Posted June 26, 2016 Author Share Posted June 26, 2016 Hi When I create UniDateTimePicker in runtime,the above code,don't work! Procedure TMainForm.CreateWindow(FormclassName, FormCaption, FormHint: string; FormWidth,FormHeight:Integer); var FormTemp :TUniForm; UniDateTimePicker1: TUniDateTimePicker; Begin FormTemp := TUniFormClass(FindClass('T'+FormclassName)).Create(UniApplication); FormTemp.Caption:=FormCaption; FormTemp.Hint:=FormHint; FormTemp.Width:=FormWidth; FormTemp.Height:=FormHeight; UniDateTimePicker1:=TUniDateTimePicker.Create(FormTemp); UniDateTimePicker1.Parent :=FormTemp; UniDateTimePicker1.Top:=100; UniDateTimePicker1.Left:=100; UniDateTimePicker1.Width:=121; UniDateTimePicker1.ClientEvents.UniEvents.Values['beforeInit']:='function (sender, config) {sender.plugins = [new Ext.ux.JalaliDatePlugin]}'; FormTemp.ShowModal(); End; Best Regards. Quote Link to comment Share on other sites More sharing options...
ZigZig Posted June 26, 2016 Share Posted June 26, 2016 You must give a Name to your component (UniDateTimePicker1.Name := ...) 1 Quote Link to comment Share on other sites More sharing options...
ariopax Posted June 26, 2016 Author Share Posted June 26, 2016 Hi ZigZig Thanks,It's worked! Best Regards. 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.