We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to ensure lane header text appears on a single line

Hi,

See the attached screenshot for an example of my challenge.
Even though the lane height is more than adequate to allow the text to fit on a single line, the text wraps to a second line.

I would assume that the label within the lane header would grow in width as the lane is resized.
Is this not true?

How would you suggest that I accomplish what I am looking to do - get the text on a single line (with the ability for the text to wrap to a second line should the lane height necessitate it).

Thanks for any guidance.

Jim

Attachment: Syncfusion__Lane_Header_Label_Width__07Jun2015_cab52628.zip

3 Replies

SG Shyam G Syncfusion Team June 8, 2015 11:35 AM UTC

Hi Jim

Thanks for using Syncfusion products.

Please note that the default value for the swimlane header width is 30, so that the header text is not wrapped properly. We suggest you to increase the width value for the swimlane header in order to achieve your requirement. Please refer the code snippet below.

Code snippet:

Lane swimLane = new Lane();

 swimLane.Name = "swimlane";

 swimLane.Header.Text = "";

 //set the width for the header
swimLane.Header.Width = 120;

Please let me know if any concerns.

Regards,
Shyam G



JJ Jim Jacobs August 24, 2015 05:44 PM UTC

Hi Shyam,

This does not seem to work.
See the attached screenshot.
The vertical lane seems to be fine; just the horzontal.

Here's a snippet of code from my nodeCollectioChangeHandler:

... } else if (args.changeType == "insert" && args.element && args.element.isLane) {
                var lane = args.element;
                if (lane.orientation == "horizontal") {
                    lane.minHeight = 120;
                    lane.minWidth = 550;
                    lane.header.width = 110; // Ensure a wider label so it doesn't wrap (default = 30)
                    lane.header.height = 40;
                    lane.header.fontSize = 12;
                }
                if (lane.orientation == "vertical") {
                    lane.minHeight = 550;
                    lane.minWidth = 250;
                    lane.header.width = 240; // Ensure a wider label so it doesn't wrap (default = 30)
                    lane.header.height = 40;
                    lane.header.fontSize = 12;
                }
                diagram.updateNode(lane.name, {});
            } else if ...

If a interrogate the lane.header.width in the selectionChangeHandler (when I click on it) - it shows 60 ???

What am I doing wrong?

Thanks

Jim

Attachment: Syncfusion__Lane_Header_Label_Width__24aug2015_1cbe228b.zip


KR Kameshwaran R Syncfusion Team August 25, 2015 09:09 AM UTC

Hi Jim

Thanks for your update.

We have achieved your requirement in the sample and it is available in the below link for download.

Sample: sample

Please let us know if you need further assistance.

Regards,

Kameshwaran R.


Loader.
Up arrow icon