Execute function if comments are rendered

Hi!

Is there any way to check if ticket comments are rendered like normal fields:
fd.field('Field').ready().then(function(){
...
}

Furthermore, it would be highly appreciated if there is any chance that private comments get their own css class in future releases. Please direct me in the right direction for future requests if I'm wrong with that request here :slight_smile:

Thank you!
Regards,
mrFaulwurf

Hello! I have passed your question and request to developers and will inform you about the result.

Hi @e.evseychik,

Today I'm facing an related error:
image

Bug or expected that the promise won't work with the requester field?

Thank you!
Regards,
mrFaulwurf

The developers will discuss implementing ready() for comments and other controls (including the Requester field) and a separate selector for private comments. I will keep you posted about updates.

For now, you can use the following workarounds:

fd.field('Requester').requesterFieldComponent.ready()

to make work the promise for the Requester field and

fd.spRendered(function () {
    ticketForm.Render().then(function () {
        ticketForm._components.comments.then(function () {
            var pcs = $('.private-comment-icon');
            pcs.each(function (i) {
                i.parent().parent().addClass('private');
            });
        });
    });
});

Since we load new comments every 5 seconds, you should perform the latter code rather frequently, e.g. every 0.5 seconds.

1 Like

Hello! Now private comment blocks have an additional class private. Please clear the browser cache to make it work.

1 Like