CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Dynamically creat controlls / components

Questions & Answers about IWCGJQuery Suite.

by Amun-Rah » 23 Nov 2015 15:59

I have a Problem regarding the dynamic construction of a view. When i dynamically create controls (via code) in my view (e.g. IWCGJQTreeView) the treeview is not displayed. It is also not existent in the resulting HTML. When i create the same control with the delphi design editor is is correctly displayed. Is there something that needs to be done adittionally to enable the dynamic construction?
Amun-Rah
 
Posts: 2
Joined: 17 Nov 2015 15:29

by assapan » 23 Nov 2015 18:04

Hi,
You have to check if you gave a name and a parent to your component
Code: Select all
 
  Tv:=TIWCGJQTreeView.Create(Self);
  Tv.Parent:=RegionTests;
  Tv.Align:=alclient;
  Tv.Name:=CGFindUniqueComponentName(RegionTests,'tv_');
  for I := 0 to 9 do
  begin
    with Tv.TreeNodes.Add do begin
      Caption:=Format('Node %d',[i]);
    end;
  end;
Want to visit Ardeche http://leclosdelarc.fr/index.php
The Pont d’Arc Cavern http://en.cavernedupontdarc.fr
Image
User avatar
assapan
 
Posts: 600
Joined: 16 Dec 2013 12:04
Location: France

by Alexander Bulei » 23 Nov 2015 18:28

Hi Amun-Rah,

If you are creating on some async Event, you need use AjaxReRender function.
Check the forum for more information.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to Q & A

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.