Skip to Main Content

Columns of Interactive Report get misplaced after AJAX load of images

KWCJan 21 2021

Hi,
We have a basic report. And then we have JavaScript code (Dynamic Action) to fetch images to the relevant row in the IMAGE column (which is a textfield containing the URL of the relevant image).
The event is set to "After Refresh" and selection type is set as "Region". The "Fire on initialization" is set to "Yes".
The JS code is as follows:
$("td[headers=image]").each( function(e) {
var url = $(this).text();
var that = $(this);

$.ajax({
type: 'GET',
url: url,
processData: false,
success: function (data) {
that.html('<img src="' + url + '"></img>');
},
error: function (xhr) {
that.html('<img src="#APP_IMAGES#error.JPG"/>');
}
});
});

21-01-2021 10-00-15.pngBut then the header columns and the value columns get misplaced.
Currently I have a workaround by adding another Dynamic Action which executes right afterwards:
location.reload(); --But this is not so reliable as it weirdly sometimes do not work.

What can I do to fix this "misplacement" issue?

Thanks in advance!
Regards,
K.

Comments
Post Details
Added on Jan 21 2021
5 comments
27 views