CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Wrap node text?

by asp » 06 Dec 2016 13:20

Hi!

Is it possible to wrap node text if it doesn't fit the tree client area?
asp
 
Posts: 235
Joined: 06 Dec 2013 11:17
Location: Moscow, Russia

by Alexander Bulei » 06 Dec 2016 13:30

Hi asp,

If possible, only by CSS style...

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 asp » 07 Dec 2016 13:33

Hi, Alexander!

Based on the plugin documentation I added my css class

Code: Select all
span.myClass a {white-space: normal;}


and added this class as addClass for the node:

Code: Select all
AJSon:= TSuperObject.Create(stArray);
  for i := 0 to 10 do begin
    Inc(CurId);
    JSonObj:= SO();
    JSonObj.S['key']:= IntToStr(CurId);
    JSonObj.S['title']:= 'bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla Node ' + IntToStr(CurId);
    JSonObj.B['isFolder']:= true;
    JSonObj.B['isLazy']:= true;
    JSonObj.S['addClass']:= 'myClass';
    AJSon.AsArray.Add(JSonObj);
  end;


Now, it begins to wrap the text, but not perfect:

Image

It seems that the margin of the node is not counting. Perhaps you could advice me something. Sample project is in the attachment.
You do not have the required permissions to view the files attached to this post.
asp
 
Posts: 235
Joined: 06 Dec 2013 11:17
Location: Moscow, Russia

by Alexander Bulei » 07 Dec 2016 15:41

Hi asp,

By screenshot, its already looking fine...

You want wrap below the folder icons? If yes, why? You should try to see it with sub levels..

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 asp » 09 Dec 2016 14:09

Hi, Alexander!

Alexander Bulei wrote:Hi asp,

By screenshot, its already looking fine...




Not fine, that is the problem. Look to the screenshot

Image

The tree is rendered with the scrollbar (not should). That's happened because the text after wrapping remains long enough to exceed the client width.
asp
 
Posts: 235
Joined: 06 Dec 2013 11:17
Location: Moscow, Russia

by Alexander Bulei » 09 Dec 2016 17:26

Hi asp,

It's not easy...
You must change the structure of css...

Attached your chanegd css file,
replace your one and you will be suprised :D

Best Regards.
You do not have the required permissions to view the files attached to this post.
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 asp » 12 Dec 2016 10:58

Thanks a lot, Alexander!

Exactly what I needed!
asp
 
Posts: 235
Joined: 06 Dec 2013 11:17
Location: Moscow, Russia


Return to JQDynaTree

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.