CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Get the caption of a TreeNode selected in TIWCGJQTreeView

by fcoalvarado » 18 Sep 2013 14:51

How can I get the caption of the item select in a TIWCGJQTreeView?
The TreeView1JQEventsClick and TreeView1JQEventsSelect events are fired
when the user clicks anywhere in the tree view, but I can't get the
caption of the selected item.

Also, how you set a different picture for sub-items?
I dropped a TIWImageList, set the TIWCGJQTreeView.Images property to it
and use this code:

tvSubItem := tvNode.SubItems.Add;
tvSubItem.Picture.ImageIndex := 1;
tvSubItem.Caption := 'This Caption I need to Get';

but the image is the same for parent and child item.

Best Regards

Francisco Alvarado
fcoalvarado
 
Posts: 12
Joined: 14 Aug 2013 01:57

by Alexander Bulei » 18 Sep 2013 18:07

Hi fcoalvarado,

For do this, you need activate UIPlugin and use OnSelect event (event more appropriate).

Then use this

delphi code
JQTreeViewOptions.UIPlugin.SelectedNode


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

by fcoalvarado » 18 Sep 2013 20:19

Thank you, that worked!

delphi code
procedure TRBDocs0.tvDocumentsJQEventsSelect(Sender: TObject; AParams: TStringList);
var
s: String;
i: Integer;
begin
// Just to know what's in the parameters
for i := 0 to AParams.Count -1 do
s := s + '; ' + AParams[i];
// Only need the children captions
if not tvDocuments.JQTreeViewOptions.UIPlugin.SelectedNode.HasChildren then
eCaption.Text := tvDocuments.JQTreeViewOptions.UIPlugin.SelectedNode.Caption;
end;
fcoalvarado
 
Posts: 12
Joined: 14 Aug 2013 01:57


Return to JQTreeView

Who is online

Users browsing this forum: No registered users and 3 guests

Contact Us.