J
J
Ji002019-05-18 20:50:18
HTML
Ji00, 2019-05-18 20:50:18

How to implement continuous data transfer from table to sidebar?

There was a need in the sidebar of the table, to transfer the object that is formed in GAS, with the next selection of a new active cell. Acceptance by the sidebar of the object should happen automatically. An example using events in the sidebar (on a button click or mouse over) is not suitable. If my task can be implemented in pure js, please help!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Chuvilev, 2019-05-18
@FrontEndTarot

Try to attach a function to the onFocus event that takes data, forwards it to your object and sets the value from the object to the sidebar.

M
Maxim Stoyanov, 2019-10-18
@stomaks

This is best done via a recursive function call in the sidebar code itself:
something like this

function getData ( data ) {
  // Тут обработка полученных данных
  
  // Тут можно реализовать условие прекращение получения данных

  // Повторный запрос данных
  google.script.run
  .withSuccessHandler( getData ) // Название текущей функции
  .getData() // Название функции на сервере
}

---
Maxim Stoyanov (stomaks), developer of Google Apps Script .
g-apps-script.com
stomaks.me

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question