Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IwGrid + HTML Template + Async event = Position Problem
#1
Buongiorno a tutti,


I have a problem with the IWGRID after an onAsync event : it loses its position. 

Let me explain : The IWGRID (yellow)  is placed in an HTML Template and its position is at the top of the page.

   

When I load the data into the grid through an Async event (eg IWButtonAsyncClick) the IWGRID moves to the foot of the page. 

   

I use the IWGRID.refresh command to bring up the updated data.
When I press F5 the IWGRID it positions itself correctly.

When I use an OnClick event to load data into cells, IWGRID always positions itself correctly

   

If I don't use the HTML template it works fine.

I have made several attempts, but I do not understand if I am making a mistake or if there is a problem in the Intraweb

I am attaching photos and a sample project.

Delphi 10.1 - Intraweb 15.2.37

Thanks in advance.


Attached Files
.zip   TestGrid2.zip (Size: 58.18 KB / Downloads: 7)
Reply
#2
I'll have a look and get back to you.
Reply
#3
This one is simple... You need a container for your IWGrid (the same is true for other controls as well) that will be rendered in async mode.

In your template your IWGrid is parented to the BODY of the HTML page. So, when the grid is re-rendered in async mode it's just added to the body, however, once there is no parent element (a DIV, for instance) it will be displayed at the bottom of the page.

To fix that, just add a <div> element as the grid container. Example:

<div id=gridContainer>
{%IWGRID1%}
</div>

Please, see the attached project. 

It will work as expected.

Cheers,


Attached Files
.zip   TestGrid2.zip (Size: 53.52 KB / Downloads: 7)
Reply
#4
(09-28-2021, 09:08 AM)Alexandre Machado Wrote: This one is simple... You need a container for your IWGrid (the same is true for other controls as well) that will be rendered in async mode.

In your template your IWGrid is parented to the BODY of the HTML page. So, when the grid is re-rendered in async mode it's just added to the body, however, once there is no parent element (a DIV, for instance) it will be displayed at the bottom of the page.

To fix that, just add a <div> element as the grid container. Example:

<div id=gridContainer>
{%IWGRID1%}
</div>

Please, see the attached project. 

It will work as expected.

Cheers,


Great ! It works perfectly. 

Thanks for the instructions, they were very helpful.

Bye
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)