arilotta Posted August 21, 2018 Share 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 Link to comment Share on other sites More sharing options...
Sherzod Posted August 21, 2018 Share Posted August 21, 2018 Hi, Have you tried? UniPanel1.JSInterface.JSCall('updateLayout', []); ... UniPanel3.JSInterface.JSCode(#1'.setConfig({flex:1});'); ... UniPanel1.JSInterface.JSCall('updateLayout', []); Link to comment Share on other sites More sharing options...
arilotta Posted August 21, 2018 Author Share Posted August 21, 2018 Hi Delphi Dev, unfortunately it doesn't seem to work... Link to comment Share on other sites More sharing options...
Sherzod Posted August 21, 2018 Share 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 ? Link to comment Share on other sites More sharing options...
arilotta Posted August 21, 2018 Author Share Posted August 21, 2018 Using build 1425. Please find attached a simple test case. Thank you Andrea UniGUI RT Flex test.zip Link to comment Share on other sites More sharing options...
Sherzod Posted August 21, 2018 Share 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 <---------- Link to comment Share on other sites More sharing options...
arilotta Posted August 21, 2018 Author Share Posted August 21, 2018 Thank you, but still doesn't work. What could be the reason ? Link to comment Share on other sites More sharing options...
Sherzod Posted August 21, 2018 Share Posted August 21, 2018 Sorry, are you using extjs4 ? Link to comment Share on other sites More sharing options...
arilotta Posted August 21, 2018 Author Share Posted August 21, 2018 Yes, build 1425 has ExtJS v. 4.2.5.1763 Link to comment Share on other sites More sharing options...
Sherzod Posted August 21, 2018 Share Posted August 21, 2018 Can you try doLayout instead of updateLayout? Link to comment Share on other sites More sharing options...
arilotta Posted August 21, 2018 Author Share 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 <---------- Link to comment Share on other sites More sharing options...
Sherzod Posted August 21, 2018 Share Posted August 21, 2018 Ok, I will check Link to comment Share on other sites More sharing options...
Sherzod Posted August 21, 2018 Share Posted August 21, 2018 Try this: UniPanel2.layoutconfig.Flex:=1; UniPanel2.JSInterface.JSAssign('flex', [1]); UniPanel1.JSInterface.JSCall('doLayout', []); Link to comment Share on other sites More sharing options...
arilotta Posted August 22, 2018 Author Share Posted August 22, 2018 Thank you Delphi Dev, it works perfetcly ! 1 Link to comment Share on other sites More sharing options...
horacio Posted September 18, 2022 Share 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' Link to comment Share on other sites More sharing options...
Sherzod Posted September 18, 2022 Share 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. Link to comment Share on other sites More sharing options...
horacio Posted September 18, 2022 Share 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? Link to comment Share on other sites More sharing options...
Abaksoft Posted September 18, 2022 Share Posted September 18, 2022 A good portal : https://www.w3schools.com/jsref/prop_style_columnwidth.asp Link to comment Share on other sites More sharing options...
horacio Posted September 18, 2022 Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now