arilotta Posted August 21, 2018 Posted August 21, 2018 Hi all, apparently it is not possible to change the flex at runtime, for example for a panel. Is there a magic JS script that let the component redraw himself using the new flex set ? Thanks Andrea Quote
Sherzod Posted August 21, 2018 Posted August 21, 2018 Hi, Have you tried? UniPanel1.JSInterface.JSCall('updateLayout', []); ... UniPanel3.JSInterface.JSCode(#1'.setConfig({flex:1});'); ... UniPanel1.JSInterface.JSCall('updateLayout', []); Quote
arilotta Posted August 21, 2018 Author Posted August 21, 2018 Hi Delphi Dev, unfortunately it doesn't seem to work... Quote
Sherzod Posted August 21, 2018 Posted August 21, 2018 Hi Delphi Dev, unfortunately it doesn't seem to work... Sorry, can you make a simple testcase for this ?! Which build are you using ? Quote
arilotta Posted August 21, 2018 Author Posted August 21, 2018 Using build 1425. Please find attached a simple test case. Thank you Andrea UniGUI RT Flex test.zip Quote
Sherzod Posted August 21, 2018 Posted August 21, 2018 UniPanel1.JSInterface.JSCall('updateLayout', []); ... UniPanel3.JSInterface.JSCode(#1'.setConfig({flex:1});'); ... UniPanel1.JSInterface.JSCall('updateLayout', []); updateLayout for parent panel: UniPanel2.layoutconfig.Flex:=1; UniPanel2.JSInterface.JSCode(#1'.setConfig({flex:1});'); UniPanel1.JSInterface.JSCall('updateLayout', []); // UniPanel1 <---------- Quote
arilotta Posted August 21, 2018 Author Posted August 21, 2018 Thank you, but still doesn't work. What could be the reason ? Quote
arilotta Posted August 21, 2018 Author Posted August 21, 2018 Yes, build 1425 has ExtJS v. 4.2.5.1763 Quote
Sherzod Posted August 21, 2018 Posted August 21, 2018 Can you try doLayout instead of updateLayout? Quote
arilotta Posted August 21, 2018 Author Posted August 21, 2018 Tried the following, but nothing happens. UniPanel2.layoutconfig.Flex:=1; UniPanel2.JSInterface.JSCode(#1'.setConfig({flex:1});'); UniPanel1.JSInterface.JSCall('doLayout', []); // UniPanel1 <---------- Quote
Sherzod Posted August 21, 2018 Posted August 21, 2018 Try this: UniPanel2.layoutconfig.Flex:=1; UniPanel2.JSInterface.JSAssign('flex', [1]); UniPanel1.JSInterface.JSCall('doLayout', []); Quote
arilotta Posted August 22, 2018 Author Posted August 22, 2018 Thank you Delphi Dev, it works perfetcly ! 1 Quote
horacio Posted September 18, 2022 Posted September 18, 2022 On 8/21/2018 at 11:56 AM, Sherzod said: Try this: UniPanel2.layoutconfig.Flex:=1; UniPanel2.JSInterface.JSAssign('flex', [1]); UniPanel1.JSInterface.JSCall('doLayout', []); Hi, with Layout Column does not work change ColumnWidth UniPanel4.layoutconfig.ColumnWidth := 0.5; UniPanel4.JSInterface.JSCode(#1'.setConfig({ColumnWidth :0.5});'); UniPanel3.JSInterface.JSCall('updateLayout', []); //Panel with Layout = 'column' Quote
Sherzod Posted September 18, 2022 Posted September 18, 2022 Hello, 1 hour ago, horacio said: UniPanel4.JSInterface.JSCode(#1'.setConfig({ColumnWidth :0.5});'); Be aware that JS is case sensitive! So try this: columnWidth instead of ColumnWidth. Quote
horacio Posted September 18, 2022 Posted September 18, 2022 8 hours ago, Sherzod said: Hola, ¡Tenga en cuenta que JS distingue entre mayúsculas y minúsculas! Entonces intente esto: columnWidth en lugar de ColumnWidth. ¡Thaks it work! Where can I find correct names JS like columnWidth, Flex, Etc? Quote
Abaksoft Posted September 18, 2022 Posted September 18, 2022 A good portal : https://www.w3schools.com/jsref/prop_style_columnwidth.asp Quote
horacio Posted September 18, 2022 Posted September 18, 2022 47 minutes ago, Abaksoft said: A good portal : https://www.w3schools.com/jsref/prop_style_columnwidth.asp Thanks. I will take the names of this site. 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.