Actions within Rich text field

112 views
Skip to first unread message

karam mohammed 1

unread,
Jul 24, 2025, 7:39:18 PM7/24/25
to mementodatabase
I asked if it’s possible to make each button in a rich text field perform specific actions, like changing the value of a field.

I need this as I organize linked entries in table and I need to put bottom to edit each linked entry beside each one 
I do this as I noticed that hiding linked enteries make opening parent entry faster



This is Example . Thanks in advance

(function () {
    var e = entry();
    var outputField = "Test";

    var html = ''
        + '<style>'
        + 'table.simple { width: 100%; border-collapse: collapse; direction: ltr; font-family: sans-serif; font-size: 14px; }'
        + 'th, td { border: 1px solid #ccc; padding: 6px; text-align: center; }'
        + 'th { background: #c8e6c9; }'
        + '.btn { padding: 6px 12px; margin: 2px; background: #4CAF50; color: white; border-radius: 4px; font-size: 14px; text-decoration: none; cursor: pointer; }'
        + '</style>'

        + '<table class="simple">'
        + '<thead><tr><th>Button</th><th>Action</th></tr></thead>'
        + '<tbody>'
        + '<tr><td>A</td><td><button class="btn">A</button></td></tr>'
        + '<tr><td>B</td><td><button class="btn">B</button></td></tr>'
        + '<tr><td>C</td><td><button class="btn">C</button></td></tr>'
        + '</tbody>'
        + '</table>';

    e.set(outputField, html);
})();

Mmm

unread,
Aug 3, 2025, 6:57:31 AM8/3/25
to mementodatabase
Автор удалил тему "Diamond layoot".
Вероятно ответ найден.

Мой вариант относится к удаленной теме "Diamond layoot".

Для решения нужно добавить в начало группы элементов регулируемый по ширине текстовый элемент.
В каждой строке должно быть четыре элемента: текст, чекбокс, текст, чекбокс.

В примере используется не ромб, а параболы.

К сожалению, я не знаю, как получить ширину диалогового окна. 
Кроме того, она будет зависеть от характеристик экрана устройства.
Поэтому настройки параметров выполнены подбором вручную:

— отступ от левого края:

var indent = 20;
        
— интервал между параболами:

var interval = 80;

— изгиб параболы – аргумент "step",

— общая ширина – аргумент "width",

— отступ разделителя от левого края выполнен добавлением табулятора "\t" к линии,

— длина линии изменяется количеством повторов "-".

После подбора параметров, их нужно перенести в основной скрипт.

Облачное использование несколькими пользователями с разными экранами требует доработки кода и создание наборов параметров.

Шаблон с примером:

пятница, 25 июля 2025 г. в 02:39:18 UTC+3, kara...@gmail.com:
IC__03082025.jpg

karam mohammed 1

unread,
Aug 3, 2025, 7:07:24 AM8/3/25
to mementodatabase

Your script worked perfectly—thank you so much! I had deleted the topic after it remained unanswered for a long time, and after many attempts, I eventually managed to solve it myself. so It deleted it after I solved it . I really appreciate your help!

Reply all
Reply to author
Forward
0 new messages