Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IWDBGrid - (RefreshAsyncRender, DoRefreshControl)
#1
Good afternoon, working with an example template, I try to asynchronously refresh an IWDBGrid control to see the changes of a DataSet. I have used the RefreshAsyncRender method and the IWDBGrid1.DoRefreshControl := True; property. I can see the changes to the DataSet but the control scrolls below all other controls. Even if I don't have any DataSet connected to the IWDBGrid the control changes position.

Initially:

{%IWBUTTON1%}
{%IWBUTTON2%}
{%IWDBGRID1%}
{%IWBUTTON3%}
{%IWBUTTON4%}


After applying the mentioned method and property:

{%IWBUTTON1%}
{%IWBUTTON2%}
{%IWBUTTON3%}
{%IWBUTTON4%}
{%IWDBGRID1%}

I attach an example project. If this is an IntraWeb failure, which of the two ways should I use to correctly refresh the IWDBGrid asynchronously? Thanks


Attached Files
.zip   RefreshError.zip (Size: 92.13 KB / Downloads: 3)
Reply
#2
If you are forcing a component to re-render in Async, like an IWGrid, please use the OnFindParentId event of the IWTemplateProcessorHTML component.

This is an example code of how it should be:

Code:
procedure TIWForm1.IWTemplateProcessorHTML1FindParentId(
  Sender: TIWTemplateProcessorHTML; AContainerContext: TIWContainerContext;
  const AComponent: TComponent; out AParentId: string);
begin
  if AComponent = MyIWGrid then
  begin
    AParentId := 'some_div';
  end;
end;

In this event you specify where the IWGrid should be inserted, i.e. what is the HTML element that should be the grid's immediate parent. You just need to provide a DOM Id of the HTML element (it doesn't even need to exist in your IntraWeb form)

Please let me know if ti works
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)