Setup IWGrid visibility in OnAsyncClick event

<< Click to Display Table of Contents >>

Navigation:  Forum >

Setup IWGrid visibility in OnAsyncClick event

Forum link

 


 

09-07-2019, 09:27 AM:

 

Hi

 

Simple bug in IW15.1.4, but very annoying.

 

OnAsyncClick Event:

 

                        IWGrid1.visible: = not IWGrid1.visible;

 

... and the position of the Grid is moving!

 

(The position is correct for the OnClick event.)

 

Other components have no such error.

 

Error presentation:

 

http://95.140.46.153/gridvisibletest

 

Can you help me with this?

 

Best regards

 

brsoft

 

Code:

 

type

 

  TIWForm1 = class(TIWAppForm)

 

    IWGrid1: TIWGrid;

 

    IWButton1: TIWButton;

 

    IWButton2: TIWButton;

 

    procedure IWButton1AsyncClick(Sender: TObject; EventParams: TStringList);

 

    procedure IWButton2Click(Sender: TObject);

 

  public

 

  end;

 

implementation

 

{$R *.dfm}

 

procedure TIWForm1.IWButton1AsyncClick(Sender: TObject; EventParams: TStringList);

 

begin

 

IWGrid1.Visible:=not IWGrid1.Visible;

 

end;

 

procedure TIWForm1.IWButton2Click(Sender: TObject);

 

begin

 

IWGrid1.Visible:=not IWGrid1.Visible;

 

end;

 

 

 


 

09-10-2019, 01:17 PM:

 

Hi

 

Unfortunately, we had to go back to IW15.0.24.

 

What will you do with the error?

 

1. "It's Not a Bug, It's a Feature." This is how it will work in the future.

 

2. The next version is expected to fix the problem.

 

Hope I get an answer ...

 

regards

 

brsoft

 


 

09-13-2019, 11:51 PM:

 

Please update to IW 15.1.5 which fixes this and other rendering issues after an Async event.

 

https://www.atozed.com/2019/09/intraweb-15-1-5/

 


 

09-14-2019, 05:28 PM:

 

Hi Alexandre,

 

Thank you for your help, but I have a new question.

 

I don't understand why the HTML code changed:

 

IW15.1.4:

 

Code:

 

<div CLASS="tblpanel tbllist" ID="MENUGRID" style="overflow-x: auto; overflow-y: auto; "><table cellpadding="0" cellspacing="0" id="TBLMENUGRID" style="">

 

<thead></thead>

 

<tbody>

 

<tr><td class="okmenuitem" style="white-space: nowrap; height: 24px; "> Menu1</td></tr>

 

<tr><td class="okmenuitem" style="white-space: nowrap; height: 24px; "> Menu2</td></tr>

 

<tr><td class="okmenuitem" style="white-space: nowrap; height: 24px; "> Menu3</td></tr>

 

<tr><td class="okmenuitem" style="white-space: nowrap; height: 24px; "> Menu4</td></tr></tbody></table></div>

 

 

 

IW15.1.5:

 

Code:

 

<div CLASS="tblpanel tbllist" ID="MENUGRID" style="overflow-x: auto; overflow-y: auto; "><div style=""><table cellpadding="0" cellspacing="0" id="TBLMENUGRID">

 

<thead></thead>

 

<tbody>

 

<tr><td class="okmenuitem" style="white-space: nowrap; height: 24px; "> Menu1</td></tr>

 

<tr><td class="okmenuitem" style="white-space: nowrap; height: 24px; "> Menu2</td></tr>

 

<tr><td class="okmenuitem" style="white-space: nowrap; height: 24px; "> Menu3</td></tr>

 

<tr><td class="okmenuitem" style="white-space: nowrap; height: 24px; "> Menu4</td></tr></tbody></table><script data-type="iw" nonce="ea3sd5wF7k7Ggc1Al/7JT/tOxgs" type="text/javascript">

 

var tbl = IW.$("TBLMENUGRID");

 

if (tbl) {

 

    tbl.style.cssText += tbl.style.cssText;

 

  }

 

</script></div></div>

 

 

 

We had to modify some javascript slightly, but it was not significant.

 

TBLIWGRID's parentNode is not an IWGRID but an anonymous div.

 

I tried to make a demo, but I couldn't make an example. In our recompiled applications, however, every grid has this HTML code.

 

Which setting does this?

 

best regards

 

brsoft

 


 

12-05-2019, 07:54 AM:

 

IWGrids sometimes would have this inner div and sometimes not depending on UseFrame property which creates other issues. The code was simplified and the internal DIV is always used