function makeRowBookmark(gridId, updateId = false) {
    const frame = document.getElementById(`${gridId}-frame`);
    const btn = frame.querySelector('.crossbeams-row-bookmark');

    if (btn === null) {
      return;
    }
    const rowId = crossbeamsUtils.currentGridRowBookmark();
    if (rowId === null) {
      btn.hidden = true;
      return;
    }
    btn.hidden = false;
    btn.dataset.bookmarkRowId = rowId;

    const bkmkClick = function bkmkClick() {
      const gridOptions = crossbeamsGridStore.getGrid(gridId);
      const node = gridOptions.api.getRowNode(btn.dataset.bookmarkRowId);
      if (node === undefined) {
        btn.hidden = true;
      } else {
        gridOptions.api.ensureNodeVisible(node, 'middle');
        node.setSelected(true);
        // If this is a tree, the bookmarked row might be collapsed.
        let currNode = node;
        while (currNode.parent) {
          if (!currNode.parent.expanded) {
            currNode.parent.setExpanded(true);
          }
          currNode = currNode.parent;
        }
      }
    };

    if (updateId) {
      btn.removeEventListener('click', bkmkClick);
    }

    btn.addEventListener('click', bkmkClick);
  }
/**
   * If this grid has a bookmark, make the bookmark button available to jump to the row.
   * @param {string} gridId - the DOM id of the grid.
   * @returns {void}
   */
If this grid has a bookmark, make the bookmark button available to jump to the row.
@param {string} gridId - the DOM id of the grid.
@returns {void}
If this grid has a bookmark make the bookmark button available to jump to the row . @param { string } gridId - the DOM id of the grid . @returns { void }
function makeRowBookmark(gridId, updateId = false) {
    const frame = document.getElementById(`${gridId}-frame`);
    const btn = frame.querySelector('.crossbeams-row-bookmark');
    if (btn === null) {
      return;
    }
    const rowId = crossbeamsUtils.currentGridRowBookmark();
    if (rowId === null) {
      btn.hidden = true;
      return;
    }
    btn.hidden = false;
    btn.dataset.bookmarkRowId = rowId;
    const bkmkClick = function bkmkClick() {
      const gridOptions = crossbeamsGridStore.getGrid(gridId);
      const node = gridOptions.api.getRowNode(btn.dataset.bookmarkRowId);
      if (node === undefined) {
        btn.hidden = true;
      } else {
        gridOptions.api.ensureNodeVisible(node, 'middle');
        node.setSelected(true);
        let currNode = node;
        while (currNode.parent) {
          if (!currNode.parent.expanded) {
            currNode.parent.setExpanded(true);
          }
          currNode = currNode.parent;
        }
      }
    };
    if (updateId) {
      btn.removeEventListener('click', bkmkClick);
    }
    btn.addEventListener('click', bkmkClick);
  }
function makeRowBookmark ( gridId , updateId = false ) { const frame = document . getElementById ( ` ${ gridId } ` ) ; const btn = frame . querySelector ( '.crossbeams-row-bookmark' ) ; if ( btn === null ) { return ; } const rowId = crossbeamsUtils . currentGridRowBookmark ( ) ; if ( rowId === null ) { btn . hidden = true ; return ; } btn . hidden = false ; btn . dataset . bookmarkRowId = rowId ; const bkmkClick = function bkmkClick ( ) { const gridOptions = crossbeamsGridStore . getGrid ( gridId ) ; const node = gridOptions . api . getRowNode ( btn . dataset . bookmarkRowId ) ; if ( node === undefined ) { btn . hidden = true ; } else { gridOptions . api . ensureNodeVisible ( node , 'middle' ) ; node . setSelected ( true ) ; let currNode = node ; while ( currNode . parent ) { if ( ! currNode . parent . expanded ) { currNode . parent . setExpanded ( true ) ; } currNode = currNode . parent ; } } } ; if ( updateId ) { btn . removeEventListener ( 'click' , bkmkClick ) ; } btn . addEventListener ( 'click' , bkmkClick ) ; }
If this grid has a bookmark, make the bookmark button available to jump to the row.
If this grid has a bookmark make the bookmark button available to jump to the row .
// If this is a tree, the bookmarked row might be collapsed.