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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Changing font attributes of a SwimLane title

Thread ID:

Created:

Updated:

Platform:

Replies:

119097 May 9,2015 03:33 PM UTC May 26,2015 11:03 AM UTC ASP.NET Web Forms 5
loading
Tags: Diagram
Jim Jacobs
Asked On May 9, 2015 03:33 PM UTC

Hi,

I realize that this is a continuation of a discussion started in Incident 138670, but since it's really a question I wanted to get it in the forums so that others may see it as well.

With the code provided in the Incident I was able to apply a fill color to both the lane headers and the main swimlane title header.
Great.
However when I tried to apply some text attribute changes, like the fontcolor, only the lane headers worked - the swimlane title was not affected.

Here's the function that I'm using to change the font color:

function ApplyTextColor(color) {
                for (var i = 0; i < diagram.model.selectedItems.children.length; i++) {
                    var object = diagram.model.selectedItems.children[i];
                    if (diagram.getObjectType(object) == 'node') { // A node or a text object
                            if (object.textBlock) { // text
                                diagram.updateLabel(object.name, object.textBlock, { fontColor: color });
                            }
                            if (object.labels[0]) { // node
                                diagram.updateLabel(object.name, object.labels[0], { fontColor: color });
                            }
                    } else if (object.isSwimlane || object.isLane) {
                        object = diagram.getNode(object.name);
                        if (object.children && object.children.length > 0) { // Main SwimLane Title - is this correct?
                            var child = diagram.findNode(object.children[0]);
                            if (child) {
                                diagram.updateLabel(child.name, child.labels[0], { fontColor: color }); // Does not work :(
                            }
                        } else { // One of the Lanes - This works for the lane headers only
                            var header = object.header;
                            header.fontColor = color;
                            diagram.updateNode(object.name, { header: header });
                        }
                    } else { // Must be a connector
                        if (object.labels[0]) {
                            diagram.updateLabel(object.name, object.labels[0], { fontColor: color });
                        }
                    }
                }

Thanks for any advice on getting this to work.

Jim

Shyam G [Syncfusion]
Replied On May 11, 2015 02:30 PM UTC

Hi Jim

Thanks for using Syncfusion products.

Please note that you can use “updateNode” API method to achieve your requirement. We have modified your code snippet and provided below.

Code snippet:

function ApplyTextColor(color) {

for (var i = 0; i < diagram.model.selectedItems.children.length; i++) {

var object = diagram.model.selectedItems.children[i];

if (diagram.getObjectType(object) == 'node') { // A node or a text object

----------

----------

} else if (object.isSwimlane || object.isLane) {

object = diagram.getNode(object.name);

// One of the Lanes - This works for the lane headers only

var header = object.header;

header.fontColor = color;

diagram.updateNode(object.name, { header: header });


} else { // Must be a connector

if (object.labels[0]) {

diagram.updateLabel(object.name, object.labels[0], { fontColor: color });

}

}

}
}

Please let me know if any concerns.

Regards,
Shyam G


Jim Jacobs
Replied On May 11, 2015 03:08 PM UTC

Hi Shyam,

I tried your code as provided, and it still does not work for the main swimlane title.
It works only for the individual lanes.

See the attached video.
I also checked the console and there were no errors raised.

Help.

Thanks

Jim

Attachment: Syncfusion__SwimLane_Title_Header_Text_Issue__11May2015_e58595cd.zip

Senthil Kumar M [Syncfusion]
Replied On May 12, 2015 12:07 PM UTC

Hi Jim,

Thanks for your update.

We are afraid that we are unable to reproduce the reported issue at our end. Could you please share your whole script file which you have used in your application to update the swimlane/lane header styles or modify the below sample to reproduce the reported issue at our end? This will help us to verify further and provide a better solution to you.

Here is the sample

Sample

Here is the video

video

Please let us know if any concern.

Regards,

Senthilkumar M


Jim Jacobs
Replied On May 25, 2015 11:25 PM UTC

Hi Jim,

Thanks for your update.

We are afraid that we are unable to reproduce the reported issue at our end. Could you please share your whole script file which you have used in your application to update the swimlane/lane header styles or modify the below sample to reproduce the reported issue at our end? This will help us to verify further and provide a better solution to you.

Here is the sample

Sample

Here is the video

video

Please let us know if any concern.

Regards,

Senthilkumar M


Hi,

Since the set of fixes that were provided to me on May 22nd, changes to the swimlane title are working fine.

Jim

Shyam G [Syncfusion]
Replied On May 26, 2015 11:03 AM UTC

Hi Jim

Thanks for your update.

We are happy to hear that your problem is resolved.

Please let me know if any concerns.

Regards,
Shyam G

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;