BobyX Posted March 15, 2018 Posted March 15, 2018 With ExtJS 4.2.x I used this way to change Caption:ShowMessage ('Sample Text');UniSession.AddJS ('Ext.get ("messagebox-1001_header_hd-textEl"). SetHTML ("My Caption")');(the way given by Delphi Developer here: http://forums.unigui.com/index.php?/topic/8106-prompt-pencere-basligi-degistirme/&do=findComment&comment=41435) But in the uniGUI 1.0.2.x with ExtJS 6.5.x it does not work, it generates an Ajax error: Ext.Msg.show({title:"New Application",msg:"Sample Text",buttons:Ext.MessageBox.OK});Ext.get("messagebox-1001_header_hd-textEl").setHTML("Your Caption"); Quote
Sherzod Posted March 15, 2018 Posted March 15, 2018 Hi, Try this: ... UniSession.AddJS('Ext.get("messagebox-1001_header-title-textEl").setText("Your Caption")'); Best regards, Quote
BobyX Posted March 15, 2018 Author Posted March 15, 2018 Hi Delphi Developer,Thank you for your quick response.Your solution, as always perfect - works OK.Best regards 1 Quote
picyka Posted July 22, 2022 Posted July 22, 2022 Em 15/03/2018 às 13h23, Sherzod disse: Oi Tente isso: ... UniSession.AddJS('Ext.get("messagebox-1001_header-title-textEl").setText("Your Caption")'); Atenciosamente Hello, any tricks when EnableSynchronousOperations is true? Quote
Sherzod Posted July 22, 2022 Posted July 22, 2022 Just now, picyka said: any tricks when EnableSynchronousOperations is true? Hello, Can you please explain in more detail? What is the issue? Quote
picyka Posted July 22, 2022 Posted July 22, 2022 1 minuto atrás, Sherzod disse: Olá Pode explicar com mais detalhes? Qual é o problema? I use the EnableSynchronousOperations property is true, so in this case the message is modal, it wouldn't change the title. Quote
Sherzod Posted July 22, 2022 Posted July 22, 2022 21 minutes ago, picyka said: I use the EnableSynchronousOperations property is true, so in this case the message is modal, it wouldn't change the title. Okay. There is a workaround... Quote
Sherzod Posted July 22, 2022 Posted July 22, 2022 1 hour ago, picyka said: I use the EnableSynchronousOperations property is true, so in this case the message is modal, it wouldn't change the title. Workaround: 1. MainForm.Script -> Ext.on('show', function() { if (arguments[0].id === "messagebox-1001" && window.msgboxTitle !== "") { arguments[0].setTitle(window.msgboxTitle); } }); 2. Usage -> procedure TMainForm.UniButton1Click(Sender: TObject); begin JSInterface.JSCode('window.msgboxTitle="New title";'); MessageDlg('Test', TMsgDlgType.mtInformation, [TMsgDlgBtn.mbOK]); JSInterface.JSCode('window.msgboxTitle="";'); end; 1 Quote
picyka Posted July 22, 2022 Posted July 22, 2022 17 minutos atrás, Sherzod disse: Solução alternativa: 1. MainForm.Script -> Ext.on('show', function() { if (arguments[0].id === "messagebox-1001" && window.msgboxTitle !== "") { arguments[0].setTitle(window.msgboxTitle); } }); 2. Uso -> procedure TMainForm.UniButton1Click(Sender: TObject); begin JSInterface.JSCode('window.msgboxTitle="New title";'); MessageDlg('Test', TMsgDlgType.mtInformation, [TMsgDlgBtn.mbOK]); JSInterface.JSCode('window.msgboxTitle="";'); end; It works very well, thank you very much. 1 Quote
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.