Jump to content

treeview collapse


jahlxx

Recommended Posts

Hi.

 

Has the tunitreeview the events on collapsing and onexpanding?

 

Thanks.

 

Hi,

 

Directly you would not find these events in uniTreeView however you can use following events of uniTreeView.ClientEvents

             - collapse

             - expand

 

Best Regards,

Link to comment
Share on other sites

Hi.

 

I can't fund clienevent, or I don't knpw how to use it.

 

I need expandall the treeview, but in every expand of a node I need to do something.

 

In an vcl app, with the treeview component standard of delphi, I write some code in the onexpand event of the node.

then I do tree.expandall, and that's all.

 

but in treevire of unigui, I don't know how to do this.

 

some help please.

 

thanks.

Link to comment
Share on other sites

In ExtEvents Client Code: 

function beforerender(sender, eOpts)
{
   sender.addListener('afteritemexpand',
     function(node, index, item, eOpts) {
      ajaxRequest(sender,'expand',['id='+node.data.id]);
     });        
}

In ServerCode:

procedure TMainForm.TV1AjaxEvent(Sender: TComponent; EventName: string; Params: TStrings);
var
  i,id : integer;
begin
  if EventName='expand' then begin
    id:=StrToIntDef(Params.Values['id'],-1);
    for i:=0 to TV1.Items.Count-1 do begin
      if id=TWebTreeNode(TV1.Items[i]).Id then begin
        FillNode(TV1.Items[i]);
        Break;
      end;
    end;
  end;
end;

It will be similar code for collapse.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...