William Sayama November 12, 2020 07:51 0 votes Share Facebook Twitter LinkedIn Please reference the following article: Change field text colors But use the Get Record Field Element API (used on the Record Detail page) instead of the Get Record List Field Elements API (used on the Record List page). Also run the code within the handler of the Record Details event. If you still run into any issues, please share the code that you are using in this thread. 0 Comment actions Permalink
pk November 13, 2020 02:03 0 votes Share Facebook Twitter LinkedIn When i try with table field it's not return the value of field. kintone.events.on(['app.record.detail.show'], function (event){ let record = event.record; let resTable = kintone.app.record.getFieldElement('Time') console.log('resTable', resTable); } 0 Comment actions Permalink
pk November 13, 2020 03:51 0 votes Share Facebook Twitter LinkedIn Notes The retrieval of data and the DOM's style is supported Changing the internal structure of the DOM may lead to features not functioning correctly after a Kintone update. The following fields cannot be retrieved, and null will be returned Status Assignee Fields within tables <<<<<< Fields within the Related records Field group Null will be returned if you specify a field you have no access to. 0 Comment actions Permalink
pk November 13, 2020 03:53 0 votes Share Facebook Twitter LinkedIn Back to my question "How to change color of time in the tables"? 0 Comment actions Permalink
Sean Tachibana November 14, 2020 17:17 0 votes Share Facebook Twitter LinkedIn Hello pk, As you know, you can't get the fields in the table with getFieldElement. If you want to change the color of a field in the table, the only way is to get it with a DOM manipulation. If you want to use getFieldElement to get and handle the elements of the table itself, I think it's the following: var $trs = $(kintone.app.record.getFieldElement("Table")).find("tbody > tr"); Even if you use getFieldElement, you will still need to manipulate the DOM, so I think it would be best to use something like settimeout until a page is completely displayed and then retrieves 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. 0 Comment actions Permalink
pk November 24, 2020 02:50 0 votes Share Facebook Twitter LinkedIn Thank you Sean san.May i request to add this feature in the next update. like 1. change color of a field in the table. 2. change background color of a field in the table. 0 Comment actions Permalink
William Sayama November 24, 2020 10:52 0 votes Share Facebook Twitter LinkedIn Hi pk I've shared your request with the Kintone dev team for being able to get table field elements, so that codes for coloring tables would become more stable :) 0 Comment actions Permalink
7 comments
Please reference the following article: Change field text colors
But use the Get Record Field Element API (used on the Record Detail page) instead of the Get Record List Field Elements API (used on the Record List page). Also run the code within the handler of the Record Details event.
If you still run into any issues, please share the code that you are using in this thread.
Notes
Back to my question "How to change color of time in the tables"?
Hello pk,
As you know, you can't get the fields in the table with getFieldElement.
If you want to change the color of a field in the table, the only way is to get it with a DOM manipulation.
If you want to use getFieldElement to get and handle the elements of the table itself, I think it's the following:
Thank you Sean san.
May i request to add this feature in the next update.
like
1. change color of a field in the table.
2. change background color of a field in the table.
Hi pk
I've shared your request with the Kintone dev team for being able to get table field elements, so that codes for coloring tables would become more stable :)