Advertisement
Savelyev_Vyacheslav

listeningWidget

Dec 19th, 2022
952
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. async function listeningWidget(timeout, arrId, condition=[0], step=300) {  
  2.     condition[0] += step; //condition[0] условие выхода по времени
  3.     if (s_widgets.getFieldValue('3333333333', 'action')) { // нажатие SAVE на виджете
  4.     const record = new SimpleRecord('safe_simple_defect');
  5.     const arrIDOfKanbanItem = s_widget.getFieldValue(arrId); // id группы  записей на канбан доске, sys_id + state
  6.     record.get(arrIDOfKanbanItem[0], () => {if(!arrId.includes(record.state)) {condition[0] = timeout+step;}});
  7.     } else if(s_widgets.getFieldValue('3333333333', 'cancelAction')) {  return; }
  8.     if(condition[0] > timeout) { s_widget_custom.updateData(); return; }
  9.     setTimeout(listeningWidget, step, timeout, arrId, condition);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement