Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom field not executing when loading issue v8.5.9

Sijo kurien April 6, 2021

We a custom field which is a multi select text field and wiki rendered,

We have added an AJS code as html as below,

<script> 
AJS.$(document).ready(function() {

AJS.$("#rowForcustomfield_10503").css({"width":"130%"});

AJS.$('.confluenceTable').find('tr').each(function() {
var tds = AJS.$(this).find('th');
var len = tds.length;
for (var i = 0; i < len; i++) { AJS.$(tds[i]).css('text-align', 'center'); AJS.$(tds[i]).css('color', 'white'); AJS.$(tds[i]).css('background-color', '#5F5F5F '); } 

});

window.alert("Hi");

var ths = AJS.$("table tbody tr").find("th");
var len = ths.length;
for (var i = 0; i < len; i++) {
AJS.$(ths[i]).css({"width":"1px","white-space":"nowrap"});
}

AJS.$('.confluenceTable').find('tr').each(function() {
AJS.$(this).css('background-color', '#F2F2F2 ');
AJS.$(this).css('background-color', '#F1F1F1 ');

var tds = AJS.$(this).find('td');
var len = tds.length;
for (var i = 0; i < len; i++) {
AJS.$(tds[i]).css('text-align', 'center');
AJS.$(tds[i]).css('color', 'black');
AJS.$(tds[i]).css({"width":"1px","white-space":"nowrap"});

});

It was coming with wrapping and misaligned. Hence we ran it in console and it worked, the custom field came no wrapped and worked fine. We have added a window.alert("Hi") to test and it displayed when run in console and when we edited the custom field.

BUT not while loading page. Please help

1 answer

0 votes
Sijo kurien April 13, 2021

Can someone please help me here?  Even simple window.alert is not working, but if i click on the field in the issue screen it works but not when loading the page.

Suggest an answer

Log in or Sign up to answer