Color in table (detail screen)

(function () {

“use strict”;

//Create an event handler for the Record List

kintone.events.on(‘app.record.detail.show’, function (event) {

varfontColorRed = “#ff0000”;

vartableRecords = event.record.案件.value;

console.log(tableRecords);

for (vari = 0; i < tableRecords.length; i++) {

varcategory = tableRecords[i].value[‘進行状況’].value;

varsetClass = document.getElementsByClassName(‘control-value-gaia value-5521523’);

if (category == ‘完了’) {

$(document).ready(function () {

$(setClass).css(‘color’, ‘#ff0000’);

});

}

console.log(“4”);

}

});

})();

 

 

// My code in below, i want to color for all value is"完了", , please help me do that. tks all Dev Teams, and have a nice day.

if (category == ‘完了’) {

$(document).ready(function () {

$(setClass).css(‘color’, ‘#ff0000’);

});

 

  • hi, somebody help me this code, why i cannot use jquery (color) for 4 items have a value 完了.?with for loop?

Hello NDC,

 

In the code above, it seems like you are retrieving the element using document.getElementsByClassName.

However, the timing of the table to be displayed is different from other fields.

You will need to use something like settimeout until a page is completely displayed and then retrieve the element.

 

JavaScript setTimeout:

https://www.javascripttutorial.net/javascript-bom/javascript-settimeout/

 

Please note that this is a DOM manipulation, so it might not work anytime after the update occurs.

 

Hopefully, this helps.

HELLO Sean Tachibana, Hello NDc,

i did same you, so cannot. plz help me.

Hello 吉田,

I was not sure what you are trying to do here because it says settimeout in the process, and from the attached image, the color seems to have changed.
The “未着手” is also red, so I thought it was not working the way you desire, but that’s a bit different from the original question.

I’m not sure if the code works because I haven’t debugged it since it’s hard to write the code by hand, but could you tell me what you are trying to do and what problems are you running into?

Hi Sean Tachibana、

i got it, Done!

Hope you have a nice day!