Page 1 of 1

Wrap node text?

PostPosted: 06 Dec 2016 13:20
by asp
Hi!

Is it possible to wrap node text if it doesn't fit the tree client area?

Re: Wrap node text?

PostPosted: 06 Dec 2016 13:30
by Alexander Bulei
Hi asp,

If possible, only by CSS style...

Best Regards.

Re: Wrap node text?

PostPosted: 07 Dec 2016 13:33
by asp
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.

Re: Wrap node text?

PostPosted: 07 Dec 2016 15:41
by Alexander Bulei
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.

Re: Wrap node text?

PostPosted: 09 Dec 2016 14:09
by asp
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.

Re: Wrap node text?

PostPosted: 09 Dec 2016 17:26
by Alexander Bulei
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.

Re: Wrap node text?

PostPosted: 12 Dec 2016 10:58
by asp
Thanks a lot, Alexander!

Exactly what I needed!