Atozed Forums
Setup IWGrid visibility in OnAsyncClick event - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: Setup IWGrid visibility in OnAsyncClick event (/thread-1221.html)



Setup IWGrid visibility in OnAsyncClick event - brsoft - 09-07-2019

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;




RE: Setup IWGrid visibility in OnAsyncClick event - brsoft - 09-10-2019

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


RE: Setup IWGrid visibility in OnAsyncClick event - Alexandre Machado - 09-13-2019

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/


RE: Setup IWGrid visibility in OnAsyncClick event - brsoft - 09-14-2019

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


RE: Setup IWGrid visibility in OnAsyncClick event - Alexandre Machado - 12-05-2019

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