Page 1 of 1

PostPosted: 13 Feb 2013 17:02
by BrunoCerqueira
Hi,

Is it possible to clear and populate this component on runtime ?

Can't find an item "add" property to do so...

thanks
BC

PostPosted: 13 Feb 2013 17:22
by Jorge Sousa
BrunoCerqueira said

Hi,

Is it possible to clear and populate this component on runtime ?

Can't find an item "add" property to do so...

thanks
BC


Hi Bruno,
You can only create select's and items.
Operations like Add / Remove can be used with AjaxReRender.

Here is simple example of dynamically creating:

procedure TIWForm15.IWAppFormCreate(Sender: TObject);
var
LSelBox: TIWCGJQMSelectBox;
LSelBoxItem: TIWCGJQMSelectBoxItem;
I: Integer;
begin
LSelBox:= IWCGJQMSelect1.SelectBoxList.Add;
for I := 0 to 5 do
begin
LSelBoxItem:= LSelBox.Items.Add;
LSelBoxItem.Caption:= 'Item ' + IntToStr(i);
LSelBoxItem.Value:= IntToStr(i);
end;
end;


Usage of AjaxReRender:


IWCGJQMSelect1.AjaxReRender();


cgdevtools

PostPosted: 13 Feb 2013 17:40
by BrunoCerqueira
Thanks that did it ;)

BC